﻿<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
    <Schema Namespace="Model.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
        <EntityType Name="AccreditationCancelDetails">
          <Key>
            <PropertyRef Name="AccreditationCancelDetailID" />
          </Key>
          <Property Name="AccreditationCancelDetailID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="OfficeLocationID" Type="bigint" />
          <Property Name="AccreditationCancelNumber" Type="varchar" MaxLength="20" />
          <Property Name="VerifiedAccreditationID" Type="bigint" Nullable="false" />
          <Property Name="OriginalAccreditationCertificateDocID" Type="bigint" />
          <Property Name="AccreditationNumber" Type="varchar" MaxLength="20" />
          <Property Name="CreatedByID" Type="bigint" Nullable="false" />
          <Property Name="CreatedDate" Type="datetime" Nullable="false" />
          <Property Name="UpdatedByID" Type="bigint" Nullable="false" />
          <Property Name="UpdatedDate" Type="datetime" Nullable="false" />
        </EntityType>
        <EntityType Name="Accreditations">
          <Key>
            <PropertyRef Name="AccreditationID" />
          </Key>
          <Property Name="AccreditationID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="ApplicationDetailID" Type="bigint" Nullable="false" />
          <Property Name="AccreditationStatusID" Type="smallint" Nullable="false" />
          <Property Name="MemberID" Type="bigint" Nullable="false" />
          <Property Name="ProvinceID" Type="smallint" />
          <Property Name="NameOnAccreditation" Type="varchar" MaxLength="100" />
          <Property Name="AccreditationNumber" Type="varchar" MaxLength="25" />
          <Property Name="IssueNumber" Type="int" Nullable="false" />
          <Property Name="CertificateNumber" Type="varchar" MaxLength="100" />
          <Property Name="DateOfIssue" Type="datetime" />
          <Property Name="DateOfExpiry" Type="datetime" />
          <Property Name="UpcomingExpiryNotificationSmsSentDate" Type="datetime" />
          <Property Name="ExpiredNotificationSmsSentDate" Type="datetime" />
          <Property Name="NumberOfLicencesAllowed" Type="int" Nullable="false" />
          <Property Name="IsLatestIssue" Type="bit" Nullable="false" />
        </EntityType>
        <EntityType Name="AccreditationStatus">
          <Key>
            <PropertyRef Name="AccreditationStatusID" />
          </Key>
          <Property Name="AccreditationStatusID" Type="smallint" Nullable="false" />
          <Property Name="Title" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <!--Errors Found During Generation:
warning 6002: The table/view 'LegitimateNATIONAL.App.Vw_AccreditationCancelDetails' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.-->
        <EntityType Name="Vw_AccreditationCancelDetails">
          <Key>
            <PropertyRef Name="AccreditationCancelDetailID" />
            <PropertyRef Name="AccreditationStatus" />
          </Key>
          <Property Name="AccreditationCancelDetailID" Type="bigint" Nullable="false" />
          <Property Name="OfficeLocationID" Type="bigint" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="AccreditationCancelNumber" Type="varchar" MaxLength="20" />
          <Property Name="AccreditationNumber" Type="varchar" MaxLength="20" />
          <Property Name="DateOfIssue" Type="datetime" />
          <Property Name="DateOfExpiry" Type="datetime" />
          <Property Name="NameOnAccreditation" Type="varchar" MaxLength="100" />
          <Property Name="CertificateNumber" Type="varchar" MaxLength="100" />
          <Property Name="AccreditationStatus" Type="varchar" MaxLength="50" Nullable="false" />
        </EntityType>
        <Association Name="FK__Accredita__Verif__249EF5AE">
          <End Role="Accreditations" Type="Self.Accreditations" Multiplicity="1" />
          <End Role="AccreditationCancelDetails" Type="Self.AccreditationCancelDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Accreditations">
              <PropertyRef Name="AccreditationID" />
            </Principal>
            <Dependent Role="AccreditationCancelDetails">
              <PropertyRef Name="VerifiedAccreditationID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Accreditations_AccreditationStatusID">
          <End Role="AccreditationStatus" Type="Self.AccreditationStatus" Multiplicity="1" />
          <End Role="Accreditations" Type="Self.Accreditations" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="AccreditationStatus">
              <PropertyRef Name="AccreditationStatusID" />
            </Principal>
            <Dependent Role="Accreditations">
              <PropertyRef Name="AccreditationStatusID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Function Name="Pr_AccreditationCancelRequestCreate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App">
          <Parameter Name="VerifiedAccreditationID" Type="bigint" Mode="In" />
          <Parameter Name="UserID" Type="bigint" Mode="In" />
        </Function>
        <EntityContainer Name="ModelStoreContainer">
          <EntitySet Name="AccreditationCancelDetails" EntityType="Self.AccreditationCancelDetails" Schema="App" store:Type="Tables" />
          <EntitySet Name="Accreditations" EntityType="Self.Accreditations" Schema="Verified" store:Type="Tables" />
          <EntitySet Name="AccreditationStatus" EntityType="Self.AccreditationStatus" Schema="Verified" store:Type="Tables" />
          <EntitySet Name="Vw_AccreditationCancelDetails" EntityType="Self.Vw_AccreditationCancelDetails" store:Type="Views" store:Schema="App">
            <DefiningQuery>SELECT 
    [Vw_AccreditationCancelDetails].[AccreditationCancelDetailID] AS [AccreditationCancelDetailID], 
    [Vw_AccreditationCancelDetails].[OfficeLocationID] AS [OfficeLocationID], 
    [Vw_AccreditationCancelDetails].[WorkflowInstanceID] AS [WorkflowInstanceID], 
    [Vw_AccreditationCancelDetails].[AccreditationCancelNumber] AS [AccreditationCancelNumber], 
    [Vw_AccreditationCancelDetails].[AccreditationNumber] AS [AccreditationNumber], 
    [Vw_AccreditationCancelDetails].[DateOfIssue] AS [DateOfIssue], 
    [Vw_AccreditationCancelDetails].[DateOfExpiry] AS [DateOfExpiry], 
    [Vw_AccreditationCancelDetails].[NameOnAccreditation] AS [NameOnAccreditation], 
    [Vw_AccreditationCancelDetails].[CertificateNumber] AS [CertificateNumber], 
    [Vw_AccreditationCancelDetails].[AccreditationStatus] AS [AccreditationStatus]
    FROM [App].[Vw_AccreditationCancelDetails] AS [Vw_AccreditationCancelDetails]</DefiningQuery>
          </EntitySet>
          <AssociationSet Name="FK__Accredita__Verif__249EF5AE" Association="Self.FK__Accredita__Verif__249EF5AE">
            <End Role="Accreditations" EntitySet="Accreditations" />
            <End Role="AccreditationCancelDetails" EntitySet="AccreditationCancelDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_Accreditations_AccreditationStatusID" Association="Self.FK_Accreditations_AccreditationStatusID">
            <End Role="AccreditationStatus" EntitySet="AccreditationStatus" />
            <End Role="Accreditations" EntitySet="Accreditations" />
          </AssociationSet>
        </EntityContainer>
      </Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Model" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityType Name="AccreditationCancelDetail">
          <Key>
            <PropertyRef Name="AccreditationCancelDetailID" />
          </Key>
          <Property Name="AccreditationCancelDetailID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="OfficeLocationID" Type="Int64" />
          <Property Name="AccreditationCancelNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="VerifiedAccreditationID" Type="Int64" Nullable="false" />
          <Property Name="OriginalAccreditationCertificateDocID" Type="Int64" />
          <Property Name="AccreditationNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="CreatedByID" Type="Int64" Nullable="false" />
          <Property Name="CreatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <Property Name="UpdatedByID" Type="Int64" Nullable="false" />
          <Property Name="UpdatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <NavigationProperty Name="Accreditation" Relationship="Model.FK__Accredita__Verif__249EF5AE" FromRole="AccreditationCancelDetail" ToRole="Accreditation" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
        </EntityType>
        <EntityContainer Name="AccreditationCancelContext" annotation:LazyLoadingEnabled="true">
          <EntitySet Name="AccreditationCancelDetails" EntityType="Self.AccreditationCancelDetail" />
          <EntitySet Name="Accreditations" EntityType="Model.Accreditation" />
          <EntitySet Name="AccreditationStatus" EntityType="Model.AccreditationStatu" />
          <EntitySet Name="Vw_AccreditationCancelDetails" EntityType="Model.Vw_AccreditationCancelDetails" />
          <AssociationSet Name="FK__Accredita__Verif__249EF5AE" Association="Model.FK__Accredita__Verif__249EF5AE">
            <End Role="Accreditation" EntitySet="Accreditations" />
            <End Role="AccreditationCancelDetail" EntitySet="AccreditationCancelDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_Accreditations_AccreditationStatusID" Association="Model.FK_Accreditations_AccreditationStatusID">
            <End Role="AccreditationStatu" EntitySet="AccreditationStatus" />
            <End Role="Accreditation" EntitySet="Accreditations" />
          </AssociationSet>
          <FunctionImport Name="Pr_AccreditationCancelRequestCreate" EntitySet="Vw_AccreditationCancelDetails" ReturnType="Collection(Model.Vw_AccreditationCancelDetails)">
            <Parameter Name="VerifiedAccreditationID" Mode="In" Type="Int64" />
            <Parameter Name="UserID" Mode="In" Type="Int64" />
          </FunctionImport>
        </EntityContainer>
        <EntityType Name="Accreditation">
          <Key>
            <PropertyRef Name="AccreditationID" />
          </Key>
          <Property Name="AccreditationID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="ApplicationDetailID" Type="Int64" Nullable="false" />
          <Property Name="AccreditationStatusID" Type="Int16" Nullable="false" />
          <Property Name="MemberID" Type="Int64" Nullable="false" />
          <Property Name="ProvinceID" Type="Int16" />
          <Property Name="NameOnAccreditation" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="AccreditationNumber" Type="String" MaxLength="25" FixedLength="false" Unicode="false" />
          <Property Name="IssueNumber" Type="Int32" Nullable="false" />
          <Property Name="CertificateNumber" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="DateOfIssue" Type="DateTime" Precision="3" />
          <Property Name="DateOfExpiry" Type="DateTime" Precision="3" />
          <Property Name="UpcomingExpiryNotificationSmsSentDate" Type="DateTime" Precision="3" />
          <Property Name="ExpiredNotificationSmsSentDate" Type="DateTime" Precision="3" />
          <Property Name="NumberOfLicencesAllowed" Type="Int32" Nullable="false" />
          <Property Name="IsLatestIssue" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="AccreditationCancelDetails" Relationship="Model.FK__Accredita__Verif__249EF5AE" FromRole="Accreditation" ToRole="AccreditationCancelDetail" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
          <NavigationProperty Name="AccreditationStatu" Relationship="Model.FK_Accreditations_AccreditationStatusID" FromRole="Accreditation" ToRole="AccreditationStatu" />
        </EntityType>
        <EntityType Name="AccreditationStatu">
          <Key>
            <PropertyRef Name="AccreditationStatusID" />
          </Key>
          <Property Name="AccreditationStatusID" Type="Int16" Nullable="false" />
          <Property Name="Title" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="Accreditations" Relationship="Model.FK_Accreditations_AccreditationStatusID" FromRole="AccreditationStatu" ToRole="Accreditation" />
        </EntityType>
        <EntityType Name="Vw_AccreditationCancelDetails">
          <Key>
            <PropertyRef Name="AccreditationCancelDetailID" />
            <PropertyRef Name="AccreditationStatus" />
          </Key>
          <Property Name="AccreditationCancelDetailID" Type="Int64" Nullable="false" />
          <Property Name="OfficeLocationID" Type="Int64" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="AccreditationCancelNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="AccreditationNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="DateOfIssue" Type="DateTime" Precision="3" />
          <Property Name="DateOfExpiry" Type="DateTime" Precision="3" />
          <Property Name="NameOnAccreditation" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="CertificateNumber" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="AccreditationStatus" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
        </EntityType>
        <Association Name="FK__Accredita__Verif__249EF5AE">
          <End Type="Model.Accreditation" Role="Accreditation" Multiplicity="1" />
          <End Type="Model.AccreditationCancelDetail" Role="AccreditationCancelDetail" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Accreditation">
              <PropertyRef Name="AccreditationID" />
            </Principal>
            <Dependent Role="AccreditationCancelDetail">
              <PropertyRef Name="VerifiedAccreditationID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Accreditations_AccreditationStatusID">
          <End Type="Model.AccreditationStatu" Role="AccreditationStatu" Multiplicity="1" />
          <End Type="Model.Accreditation" Role="Accreditation" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="AccreditationStatu">
              <PropertyRef Name="AccreditationStatusID" />
            </Principal>
            <Dependent Role="Accreditation">
              <PropertyRef Name="AccreditationStatusID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
        <EntityContainerMapping StorageEntityContainer="ModelStoreContainer" CdmEntityContainer="AccreditationCancelContext">
          <EntitySetMapping Name="AccreditationCancelDetails">
            <EntityTypeMapping TypeName="Model.AccreditationCancelDetail">
              <MappingFragment StoreEntitySet="AccreditationCancelDetails">
                <ScalarProperty Name="AccreditationCancelDetailID" ColumnName="AccreditationCancelDetailID" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="OfficeLocationID" ColumnName="OfficeLocationID" />
                <ScalarProperty Name="AccreditationCancelNumber" ColumnName="AccreditationCancelNumber" />
                <ScalarProperty Name="VerifiedAccreditationID" ColumnName="VerifiedAccreditationID" />
                <ScalarProperty Name="OriginalAccreditationCertificateDocID" ColumnName="OriginalAccreditationCertificateDocID" />
                <ScalarProperty Name="AccreditationNumber" ColumnName="AccreditationNumber" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Accreditations">
            <EntityTypeMapping TypeName="Model.Accreditation">
              <MappingFragment StoreEntitySet="Accreditations">
                <ScalarProperty Name="IsLatestIssue" ColumnName="IsLatestIssue" />
                <ScalarProperty Name="NumberOfLicencesAllowed" ColumnName="NumberOfLicencesAllowed" />
                <ScalarProperty Name="ExpiredNotificationSmsSentDate" ColumnName="ExpiredNotificationSmsSentDate" />
                <ScalarProperty Name="UpcomingExpiryNotificationSmsSentDate" ColumnName="UpcomingExpiryNotificationSmsSentDate" />
                <ScalarProperty Name="DateOfExpiry" ColumnName="DateOfExpiry" />
                <ScalarProperty Name="DateOfIssue" ColumnName="DateOfIssue" />
                <ScalarProperty Name="CertificateNumber" ColumnName="CertificateNumber" />
                <ScalarProperty Name="IssueNumber" ColumnName="IssueNumber" />
                <ScalarProperty Name="AccreditationNumber" ColumnName="AccreditationNumber" />
                <ScalarProperty Name="NameOnAccreditation" ColumnName="NameOnAccreditation" />
                <ScalarProperty Name="ProvinceID" ColumnName="ProvinceID" />
                <ScalarProperty Name="MemberID" ColumnName="MemberID" />
                <ScalarProperty Name="AccreditationStatusID" ColumnName="AccreditationStatusID" />
                <ScalarProperty Name="ApplicationDetailID" ColumnName="ApplicationDetailID" />
                <ScalarProperty Name="AccreditationID" ColumnName="AccreditationID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="AccreditationStatus">
            <EntityTypeMapping TypeName="Model.AccreditationStatu">
              <MappingFragment StoreEntitySet="AccreditationStatus">
                <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
                <ScalarProperty Name="Title" ColumnName="Title" />
                <ScalarProperty Name="AccreditationStatusID" ColumnName="AccreditationStatusID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Vw_AccreditationCancelDetails">
            <EntityTypeMapping TypeName="Model.Vw_AccreditationCancelDetails">
              <MappingFragment StoreEntitySet="Vw_AccreditationCancelDetails">
                <ScalarProperty Name="AccreditationStatus" ColumnName="AccreditationStatus" />
                <ScalarProperty Name="CertificateNumber" ColumnName="CertificateNumber" />
                <ScalarProperty Name="NameOnAccreditation" ColumnName="NameOnAccreditation" />
                <ScalarProperty Name="DateOfExpiry" ColumnName="DateOfExpiry" />
                <ScalarProperty Name="DateOfIssue" ColumnName="DateOfIssue" />
                <ScalarProperty Name="AccreditationNumber" ColumnName="AccreditationNumber" />
                <ScalarProperty Name="AccreditationCancelNumber" ColumnName="AccreditationCancelNumber" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="OfficeLocationID" ColumnName="OfficeLocationID" />
                <ScalarProperty Name="AccreditationCancelDetailID" ColumnName="AccreditationCancelDetailID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_AccreditationCancelRequestCreate" FunctionName="Model.Store.Pr_AccreditationCancelRequestCreate" />
        </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
    <Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </Connection>
    <Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
        <DesignerProperty Name="EnablePluralization" Value="true" />
        <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
        <DesignerProperty Name="UseLegacyProvider" Value="false" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams></Diagrams>
  </Designer>
</edmx:Edmx>