﻿<?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="LicenceExtensionModel.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="LicenceUpliftmentExtensionRequestDetails">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="VerifiedLicenceID" Type="bigint" Nullable="false" />
          <Property Name="Description" Type="varchar" MaxLength="500" />
          <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" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
          <Property Name="ReasonForExtension" Type="varchar(max)" />
          <Property Name="ApproverOneApproved" Type="bit" />
          <Property Name="ApproverOneComment" Type="varchar(max)" />
          <Property Name="ApproverTwoApproved" Type="bit" />
          <Property Name="ApproverTwoComment" Type="varchar(max)" />
        </EntityType>
        <EntityType Name="LicenceUpliftmentExtensionRequestDocuments">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDocumentsID" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDocumentsID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="bigint" Nullable="false" />
          <Property Name="DocumentTypeID" Type="smallint" Nullable="false" />
          <Property Name="DocumentID" Type="bigint" />
          <Property Name="IsMandatory" Type="bit" Nullable="false" />
        </EntityType>
        <EntityType Name="DocumentTypes">
          <Key>
            <PropertyRef Name="DocumentTypeID" />
          </Key>
          <Property Name="DocumentTypeID" Type="smallint" Nullable="false" />
          <Property Name="Description" Type="varchar" MaxLength="255" Nullable="false" />
          <Property Name="IsDocumentTemplate" Type="bit" Nullable="false" />
          <Property Name="IsDocumentTitleEditable" Type="bit" Nullable="false" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <EntityType Name="Licences">
          <Key>
            <PropertyRef Name="LicenceID" />
          </Key>
          <Property Name="LicenceID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="ApplicationRequestDetailID" Type="bigint" Nullable="false" />
          <Property Name="LicenceStatusID" Type="smallint" Nullable="false" />
          <Property Name="MemberID" Type="bigint" Nullable="false" />
          <Property Name="VehicleID" Type="bigint" />
          <Property Name="ModeID" Type="smallint" Nullable="false" />
          <Property Name="NameOnLicence" Type="varchar" MaxLength="100" />
          <Property Name="OperatingLicenceNumber" Type="varchar" MaxLength="18" />
          <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="Indefinite" Type="bit" Nullable="false" />
          <Property Name="UpcomingExpiryNotificationSmsSentDate" Type="datetime" />
          <Property Name="ExpiredNotificationSmsSentDate" Type="datetime" />
          <Property Name="UpliftmentReminderSmsSentDate" Type="datetime" />
          <Property Name="OriginalLTPSPermitNumber" Type="varchar" MaxLength="20" />
          <Property Name="OriginalOLASNumber" Type="varchar" MaxLength="20" />
          <Property Name="IsLatestIssue" Type="bit" />
          <Property Name="ApplicationVehicleDetailsInBulkID" Type="bigint" />
        </EntityType>
        <EntityType Name="Members">
          <Key>
            <PropertyRef Name="MemberID" />
          </Key>
          <Property Name="MemberID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="ReferenceNumber" Type="varchar" MaxLength="53" StoreGeneratedPattern="Computed" />
          <Property Name="FullName" Type="varchar" MaxLength="511" StoreGeneratedPattern="Computed" Nullable="false" />
          <Property Name="IdentityDocumentDocID" Type="bigint" />
          <Property Name="TaxClearanceCertificateDocID" Type="bigint" />
          <Property Name="SurnameOrCompanyName" Type="varchar" MaxLength="255" />
          <Property Name="FirstNames" Type="varchar" MaxLength="255" />
          <Property Name="IDTypeID" Type="smallint" />
          <Property Name="IDTypeDescription" Type="varchar" MaxLength="50" />
          <Property Name="IDNumberOrBusinessRegistrationNo" Type="varchar" MaxLength="20" />
          <Property Name="PostalAddress" Type="varchar" MaxLength="400" />
          <Property Name="PostalAddressCode" Type="varchar" MaxLength="4" />
          <Property Name="PhysicalAddress" Type="varchar" MaxLength="400" />
          <Property Name="PhysicalAddressCode" Type="varchar" MaxLength="4" />
          <Property Name="TelPhone" Type="varchar" MaxLength="14" />
          <Property Name="TelCell" Type="varchar" MaxLength="14" />
          <Property Name="TelFax" Type="varchar" MaxLength="14" />
          <Property Name="Email" Type="varchar" MaxLength="150" />
          <Property Name="SARSIncomeTaxNumber" Type="varchar" MaxLength="20" />
          <Property Name="SARSReasonIfNoTaxNumber" Type="varchar" MaxLength="1000" />
          <Property Name="TradeName" Type="varchar" MaxLength="255" />
          <Property Name="MemberStatusID" Type="smallint" Nullable="false" />
          <Property Name="OlasID" Type="bigint" />
          <Property Name="LtpsID" Type="bigint" />
          <Property Name="NeoID" Type="bigint" />
          <Property Name="BusinessTypeID" Type="bigint" />
        </EntityType>
        <!--Errors Found During Generation:
warning 6002: The table/view 'LegitimateKZN.App.Vw_LicenceUpliftmentExtensionRequestDetails' 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_LicenceUpliftmentExtensionRequestDetails">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            <PropertyRef Name="VerifiedLicenceID" />
            <PropertyRef Name="LicenceUpliftmentReferenceNumber" />
            <PropertyRef Name="MemberFullName" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="bigint" Nullable="false" />
          <Property Name="VerifiedLicenceID" Type="bigint" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="LicenceUpliftmentReferenceNumber" Type="varchar" MaxLength="10" Nullable="false" />
          <Property Name="SurnameOrCompanyName" Type="varchar" MaxLength="255" />
          <Property Name="CertificateNumber" Type="varchar" MaxLength="100" />
          <Property Name="MemberFullName" Type="varchar" MaxLength="511" Nullable="false" />
          <Property Name="MemberTaxReference" Type="varchar" MaxLength="20" />
          <Property Name="MemberIDNumber" Type="varchar" MaxLength="20" />
          <Property Name="MemberCell" Type="varchar" MaxLength="14" />
          <Property Name="WorkflowInstanceStatusID" Type="smallint" />
        </EntityType>
        <Association Name="FK_Licences_Members">
          <End Role="Members" Type="Self.Members" Multiplicity="1" />
          <End Role="Licences" Type="Self.Licences" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Members">
              <PropertyRef Name="MemberID" />
            </Principal>
            <Dependent Role="Licences">
              <PropertyRef Name="MemberID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDetails_Licences">
          <End Role="Licences" Type="Self.Licences" Multiplicity="1" />
          <End Role="LicenceUpliftmentExtensionRequestDetails" Type="Self.LicenceUpliftmentExtensionRequestDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Licences">
              <PropertyRef Name="LicenceID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDetails">
              <PropertyRef Name="VerifiedLicenceID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes">
          <End Role="DocumentTypes" Type="Self.DocumentTypes" Multiplicity="1" />
          <End Role="LicenceUpliftmentExtensionRequestDocuments" Type="Self.LicenceUpliftmentExtensionRequestDocuments" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="DocumentTypes">
              <PropertyRef Name="DocumentTypeID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDocuments">
              <PropertyRef Name="DocumentTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails">
          <End Role="LicenceUpliftmentExtensionRequestDetails" Type="Self.LicenceUpliftmentExtensionRequestDetails" Multiplicity="1" />
          <End Role="LicenceUpliftmentExtensionRequestDocuments" Type="Self.LicenceUpliftmentExtensionRequestDocuments" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="LicenceUpliftmentExtensionRequestDetails">
              <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDocuments">
              <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Function Name="Pr_CleanseUnusedVehicleData" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App" />
        <Function Name="Pr_LicenceExtensionCheckSecurity" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App">
          <Parameter Name="LicenceUpliftmentExtensionRequestDetailID" Type="bigint" Mode="In" />
          <Parameter Name="Action" Type="varchar" Mode="In" />
          <Parameter Name="UserID" Type="bigint" Mode="In" />
        </Function>
        <Function Name="Pr_LicenceExtensionPostSaveProcess" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App">
          <Parameter Name="LicenceUpliftmentExtensionRequestDetailID" Type="bigint" Mode="In" />
        </Function>
        <Function Name="Pr_LicenceExceptionsUpdate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Verified">
          <Parameter Name="LicenceID" Type="bigint" Mode="In" />
        </Function>
        <Function Name="Pr_VehicleGetLinkedByVIN" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Verified">
          <Parameter Name="VIN" Type="varchar" Mode="In" />
        </Function>
        <EntityContainer Name="LicenceExtensionModelStoreContainer">
          <EntitySet Name="LicenceUpliftmentExtensionRequestDetails" EntityType="Self.LicenceUpliftmentExtensionRequestDetails" Schema="App" store:Type="Tables" />
          <EntitySet Name="LicenceUpliftmentExtensionRequestDocuments" EntityType="Self.LicenceUpliftmentExtensionRequestDocuments" Schema="App" store:Type="Tables" />
          <EntitySet Name="DocumentTypes" EntityType="Self.DocumentTypes" Schema="Doc" store:Type="Tables" />
          <EntitySet Name="Licences" EntityType="Self.Licences" Schema="Verified" store:Type="Tables" />
          <EntitySet Name="Members" EntityType="Self.Members" Schema="Verified" store:Type="Tables" />
          <EntitySet Name="Vw_LicenceUpliftmentExtensionRequestDetails" EntityType="Self.Vw_LicenceUpliftmentExtensionRequestDetails" store:Type="Views" store:Schema="App">
            <DefiningQuery>SELECT 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[LicenceUpliftmentExtensionRequestDetailID] AS [LicenceUpliftmentExtensionRequestDetailID], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[VerifiedLicenceID] AS [VerifiedLicenceID], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[WorkflowInstanceID] AS [WorkflowInstanceID], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[LicenceUpliftmentReferenceNumber] AS [LicenceUpliftmentReferenceNumber], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[SurnameOrCompanyName] AS [SurnameOrCompanyName], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[CertificateNumber] AS [CertificateNumber], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[MemberFullName] AS [MemberFullName], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[MemberTaxReference] AS [MemberTaxReference], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[MemberIDNumber] AS [MemberIDNumber], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[MemberCell] AS [MemberCell], 
    [Vw_LicenceUpliftmentExtensionRequestDetails].[WorkflowInstanceStatusID] AS [WorkflowInstanceStatusID]
    FROM [App].[Vw_LicenceUpliftmentExtensionRequestDetails] AS [Vw_LicenceUpliftmentExtensionRequestDetails]</DefiningQuery>
          </EntitySet>
          <AssociationSet Name="FK_Licences_Members" Association="Self.FK_Licences_Members">
            <End Role="Members" EntitySet="Members" />
            <End Role="Licences" EntitySet="Licences" />
          </AssociationSet>
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDetails_Licences" Association="Self.FK_LicenceUpliftmentExtensionRequestDetails_Licences">
            <End Role="Licences" EntitySet="Licences" />
            <End Role="LicenceUpliftmentExtensionRequestDetails" EntitySet="LicenceUpliftmentExtensionRequestDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes" Association="Self.FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes">
            <End Role="DocumentTypes" EntitySet="DocumentTypes" />
            <End Role="LicenceUpliftmentExtensionRequestDocuments" EntitySet="LicenceUpliftmentExtensionRequestDocuments" />
          </AssociationSet>
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails" Association="Self.FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails">
            <End Role="LicenceUpliftmentExtensionRequestDetails" EntitySet="LicenceUpliftmentExtensionRequestDetails" />
            <End Role="LicenceUpliftmentExtensionRequestDocuments" EntitySet="LicenceUpliftmentExtensionRequestDocuments" />
          </AssociationSet>
        </EntityContainer>
      </Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Model" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityContainer Name="LicenceExtensionContext" annotation:LazyLoadingEnabled="false">
          <FunctionImport Name="Pr_LicenceUpliftmentExtensionRequestDetailsSearch">
            <Parameter Name="LicenceUpliftmentExtensionRequestDetailID" Mode="In" Type="Int64" />
            <Parameter Name="WorkflowInstanceStatusID" Mode="In" Type="Int16" />
          </FunctionImport>
          <FunctionImport Name="Pr_VehicleGetLinkedByVIN" ReturnType="Collection(String)">
          <Parameter Name="VIN" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_LicenceExceptionsUpdate">
          <Parameter Name="LicenceID" Mode="In" Type="Int64" />
          </FunctionImport>
          <FunctionImport Name="Pr_CleanseUnusedVehicleData" />
          <EntitySet Name="LicenceUpliftmentExtensionRequestDetails" EntityType="Model.LicenceUpliftmentExtensionRequestDetail" />
          <EntitySet Name="LicenceUpliftmentExtensionRequestDocuments" EntityType="Model.LicenceUpliftmentExtensionRequestDocument" />
          <EntitySet Name="Licences" EntityType="Model.Licence" />
          <EntitySet Name="Members" EntityType="Model.Member" />
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDetails_Licences" Association="Model.FK_LicenceUpliftmentExtensionRequestDetails_Licences">
            <End Role="Licence" EntitySet="Licences" />
            <End Role="LicenceUpliftmentExtensionRequestDetail" EntitySet="LicenceUpliftmentExtensionRequestDetails" />
          </AssociationSet>
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails" Association="Model.FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails">
            <End Role="LicenceUpliftmentExtensionRequestDetail" EntitySet="LicenceUpliftmentExtensionRequestDetails" />
            <End Role="LicenceUpliftmentExtensionRequestDocument" EntitySet="LicenceUpliftmentExtensionRequestDocuments" />
          </AssociationSet>
          <AssociationSet Name="FK_Licences_Members" Association="Model.FK_Licences_Members">
            <End Role="Member" EntitySet="Members" />
            <End Role="Licence" EntitySet="Licences" />
          </AssociationSet>
          <EntitySet Name="DocumentTypes" EntityType="Model.DocumentType" />
          <AssociationSet Name="FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes" Association="Model.FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes">
            <End Role="DocumentType" EntitySet="DocumentTypes" />
            <End Role="LicenceUpliftmentExtensionRequestDocument" EntitySet="LicenceUpliftmentExtensionRequestDocuments" />
          </AssociationSet>
          <FunctionImport Name="Pr_LicenceExtensionPostSaveProcess">
          <Parameter Name="LicenceUpliftmentExtensionRequestDetailID" Mode="In" Type="Int64" />
          </FunctionImport>
          <FunctionImport Name="Pr_LicenceExtensionCheckSecurity">
            <Parameter Name="LicenceUpliftmentExtensionRequestDetailID" Mode="In" Type="Int64" />
            <Parameter Name="Action" Mode="In" Type="String" />
            <Parameter Name="UserID" Mode="In" Type="Int64" />
          </FunctionImport>
          <EntitySet Name="Vw_LicenceUpliftmentExtensionRequestDetails" EntityType="Model.Vw_LicenceUpliftmentExtensionRequestDetails" />
          </EntityContainer>
        <EntityType Name="LicenceUpliftmentExtensionRequestDetail">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="Int64" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="VerifiedLicenceID" Type="Int64" Nullable="false" />
          <Property Name="Description" Type="String" MaxLength="500" 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" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="Licence" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDetails_Licences" FromRole="LicenceUpliftmentExtensionRequestDetail" ToRole="Licence" >
          </NavigationProperty>
          <NavigationProperty Name="Documents" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails" FromRole="LicenceUpliftmentExtensionRequestDetail" ToRole="LicenceUpliftmentExtensionRequestDocument" />
          <Property Name="ReasonForExtension" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Name="ApproverOneApproved" Type="Boolean" />
          <Property Name="ApproverOneComment" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Name="ApproverTwoApproved" Type="Boolean" />
          <Property Name="ApproverTwoComment" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
        </EntityType>
        <EntityType Name="LicenceUpliftmentExtensionRequestDocument">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDocumentsID" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDocumentsID" Type="Int64" Nullable="false" />
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="Int64" Nullable="false" />
          <Property Name="DocumentTypeID" Type="Int16" Nullable="false" />
          <Property Name="DocumentID" Type="Int64" />
          <Property Name="IsMandatory" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="LicenceUpliftmentExtensionRequestDetail" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails" FromRole="LicenceUpliftmentExtensionRequestDocument" ToRole="LicenceUpliftmentExtensionRequestDetail" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
          <NavigationProperty Name="DocumentType" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes" FromRole="LicenceUpliftmentExtensionRequestDocument" ToRole="DocumentType" />
        </EntityType>
        <EntityType Name="Licence">
          <Key>
            <PropertyRef Name="LicenceID" />
          </Key>
          <Property Name="LicenceID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="ApplicationRequestDetailID" Type="Int64" Nullable="false" />
          <Property Name="LicenceStatusID" Type="Int16" Nullable="false" />
          <Property Name="MemberID" Type="Int64" Nullable="false" />
          <Property Name="VehicleID" Type="Int64" />
          <Property Name="ModeID" Type="Int16" Nullable="false" />
          <Property Name="NameOnLicence" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="OperatingLicenceNumber" Type="String" MaxLength="18" 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="Indefinite" Type="Boolean" Nullable="false" />
          <Property Name="UpcomingExpiryNotificationSmsSentDate" Type="DateTime" Precision="3" />
          <Property Name="ExpiredNotificationSmsSentDate" Type="DateTime" Precision="3" />
          <Property Name="UpliftmentReminderSmsSentDate" Type="DateTime" Precision="3" />
          <Property Name="OriginalLTPSPermitNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="OriginalOLASNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="IsLatestIssue" Type="Boolean" />
          <Property Name="ApplicationVehicleDetailsInBulkID" Type="Int64" />
          <NavigationProperty Name="LicenceUpliftmentExtensionRequestDetails" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDetails_Licences" FromRole="Licence" ToRole="LicenceUpliftmentExtensionRequestDetail" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
          <NavigationProperty Name="Member" Relationship="Model.FK_Licences_Members" FromRole="Licence" ToRole="Member" />
        </EntityType>
        <EntityType Name="Member">
          <Key>
            <PropertyRef Name="MemberID" />
          </Key>
          <Property Name="MemberID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="ReferenceNumber" Type="String" MaxLength="53" FixedLength="false" Unicode="false" annotation:StoreGeneratedPattern="Computed" />
          <Property Name="FullName" Type="String" Nullable="false" MaxLength="511" FixedLength="false" Unicode="false" annotation:StoreGeneratedPattern="Computed" />
          <Property Name="IdentityDocumentDocID" Type="Int64" />
          <Property Name="TaxClearanceCertificateDocID" Type="Int64" />
          <Property Name="SurnameOrCompanyName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="FirstNames" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="IDTypeID" Type="Int16" />
          <Property Name="IDTypeDescription" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Name="IDNumberOrBusinessRegistrationNo" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="PostalAddress" Type="String" MaxLength="400" FixedLength="false" Unicode="false" />
          <Property Name="PostalAddressCode" Type="String" MaxLength="4" FixedLength="false" Unicode="false" />
          <Property Name="PhysicalAddress" Type="String" MaxLength="400" FixedLength="false" Unicode="false" />
          <Property Name="PhysicalAddressCode" Type="String" MaxLength="4" FixedLength="false" Unicode="false" />
          <Property Name="TelPhone" Type="String" MaxLength="14" FixedLength="false" Unicode="false" />
          <Property Name="TelCell" Type="String" MaxLength="14" FixedLength="false" Unicode="false" />
          <Property Name="TelFax" Type="String" MaxLength="14" FixedLength="false" Unicode="false" />
          <Property Name="Email" Type="String" MaxLength="150" FixedLength="false" Unicode="false" />
          <Property Name="SARSIncomeTaxNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="SARSReasonIfNoTaxNumber" Type="String" MaxLength="1000" FixedLength="false" Unicode="false" />
          <Property Name="TradeName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="MemberStatusID" Type="Int16" Nullable="false" />
          <Property Name="OlasID" Type="Int64" />
          <Property Name="LtpsID" Type="Int64" />
          <Property Name="NeoID" Type="Int64" />
          <Property Name="BusinessTypeID" Type="Int64" />
          <NavigationProperty Name="Licences" Relationship="Model.FK_Licences_Members" FromRole="Member" ToRole="Licence" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
        </EntityType>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDetails_Licences">
          <End Type="Model.Licence" Role="Licence" Multiplicity="1" />
          <End Type="Model.LicenceUpliftmentExtensionRequestDetail" Role="LicenceUpliftmentExtensionRequestDetail" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Licence">
              <PropertyRef Name="LicenceID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDetail">
              <PropertyRef Name="VerifiedLicenceID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails">
          <End Type="Model.LicenceUpliftmentExtensionRequestDetail" Role="LicenceUpliftmentExtensionRequestDetail" Multiplicity="1" />
          <End Type="Model.LicenceUpliftmentExtensionRequestDocument" Role="LicenceUpliftmentExtensionRequestDocument" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="LicenceUpliftmentExtensionRequestDetail">
              <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDocument">
              <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Licences_Members">
          <End Type="Model.Member" Role="Member" Multiplicity="1" />
          <End Type="Model.Licence" Role="Licence" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Member">
              <PropertyRef Name="MemberID" />
            </Principal>
            <Dependent Role="Licence">
              <PropertyRef Name="MemberID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="DocumentType">
          <Key>
            <PropertyRef Name="DocumentTypeID" />
          </Key>
          <Property Name="DocumentTypeID" Type="Int16" Nullable="false" />
          <Property Name="Description" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="IsDocumentTemplate" Type="Boolean" Nullable="false" />
          <Property Name="IsDocumentTitleEditable" Type="Boolean" Nullable="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="LicenceUpliftmentExtensionRequestDocuments" Relationship="Model.FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes" FromRole="DocumentType" ToRole="LicenceUpliftmentExtensionRequestDocument" >
            <Documentation>
              <LongDescription>[ScriptIgnore]</LongDescription>
            </Documentation>
          </NavigationProperty>
        </EntityType>
        <Association Name="FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes">
          <End Type="Model.DocumentType" Role="DocumentType" Multiplicity="1" />
          <End Type="Model.LicenceUpliftmentExtensionRequestDocument" Role="LicenceUpliftmentExtensionRequestDocument" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="DocumentType">
              <PropertyRef Name="DocumentTypeID" />
            </Principal>
            <Dependent Role="LicenceUpliftmentExtensionRequestDocument">
              <PropertyRef Name="DocumentTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="Vw_LicenceUpliftmentExtensionRequestDetails">
          <Key>
            <PropertyRef Name="LicenceUpliftmentExtensionRequestDetailID" />
            <PropertyRef Name="VerifiedLicenceID" />
            <PropertyRef Name="LicenceUpliftmentReferenceNumber" />
            <PropertyRef Name="MemberFullName" />
          </Key>
          <Property Name="LicenceUpliftmentExtensionRequestDetailID" Type="Int64" Nullable="false" />
          <Property Name="VerifiedLicenceID" Type="Int64" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="LicenceUpliftmentReferenceNumber" Type="String" Nullable="false" MaxLength="10" FixedLength="false" Unicode="false" />
          <Property Name="SurnameOrCompanyName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="CertificateNumber" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
          <Property Name="MemberFullName" Type="String" Nullable="false" MaxLength="511" FixedLength="false" Unicode="false" />
          <Property Name="MemberTaxReference" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="MemberIDNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="MemberCell" Type="String" MaxLength="14" FixedLength="false" Unicode="false" />
          <Property Name="WorkflowInstanceStatusID" Type="Int16" />
        </EntityType>
        </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="LicenceExtensionModelStoreContainer" CdmEntityContainer="LicenceExtensionContext">
          <FunctionImportMapping FunctionImportName="Pr_VehicleGetLinkedByVIN" FunctionName="LicenceExtensionModel.Store.Pr_VehicleGetLinkedByVIN" />
          <FunctionImportMapping FunctionImportName="Pr_LicenceExceptionsUpdate" FunctionName="LicenceExtensionModel.Store.Pr_LicenceExceptionsUpdate" />
          <FunctionImportMapping FunctionImportName="Pr_CleanseUnusedVehicleData" FunctionName="LicenceExtensionModel.Store.Pr_CleanseUnusedVehicleData" />
          <EntitySetMapping Name="LicenceUpliftmentExtensionRequestDetails">
            <EntityTypeMapping TypeName="Model.LicenceUpliftmentExtensionRequestDetail">
              <MappingFragment StoreEntitySet="LicenceUpliftmentExtensionRequestDetails">
                <ScalarProperty Name="ApproverTwoComment" ColumnName="ApproverTwoComment" />
                <ScalarProperty Name="ApproverTwoApproved" ColumnName="ApproverTwoApproved" />
                <ScalarProperty Name="ApproverOneComment" ColumnName="ApproverOneComment" />
                <ScalarProperty Name="ApproverOneApproved" ColumnName="ApproverOneApproved" />
                <ScalarProperty Name="ReasonForExtension" ColumnName="ReasonForExtension" />
                <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="VerifiedLicenceID" ColumnName="VerifiedLicenceID" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="LicenceUpliftmentExtensionRequestDetailID" ColumnName="LicenceUpliftmentExtensionRequestDetailID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="LicenceUpliftmentExtensionRequestDocuments">
            <EntityTypeMapping TypeName="Model.LicenceUpliftmentExtensionRequestDocument">
              <MappingFragment StoreEntitySet="LicenceUpliftmentExtensionRequestDocuments">
                <ScalarProperty Name="IsMandatory" ColumnName="IsMandatory" />
                <ScalarProperty Name="DocumentID" ColumnName="DocumentID" />
                <ScalarProperty Name="DocumentTypeID" ColumnName="DocumentTypeID" />
                <ScalarProperty Name="LicenceUpliftmentExtensionRequestDetailID" ColumnName="LicenceUpliftmentExtensionRequestDetailID" />
                <ScalarProperty Name="LicenceUpliftmentExtensionRequestDocumentsID" ColumnName="LicenceUpliftmentExtensionRequestDocumentsID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Licences">
            <EntityTypeMapping TypeName="Model.Licence">
              <MappingFragment StoreEntitySet="Licences">
                <ScalarProperty Name="ApplicationVehicleDetailsInBulkID" ColumnName="ApplicationVehicleDetailsInBulkID" />
                <ScalarProperty Name="IsLatestIssue" ColumnName="IsLatestIssue" />
                <ScalarProperty Name="OriginalOLASNumber" ColumnName="OriginalOLASNumber" />
                <ScalarProperty Name="OriginalLTPSPermitNumber" ColumnName="OriginalLTPSPermitNumber" />
                <ScalarProperty Name="UpliftmentReminderSmsSentDate" ColumnName="UpliftmentReminderSmsSentDate" />
                <ScalarProperty Name="ExpiredNotificationSmsSentDate" ColumnName="ExpiredNotificationSmsSentDate" />
                <ScalarProperty Name="UpcomingExpiryNotificationSmsSentDate" ColumnName="UpcomingExpiryNotificationSmsSentDate" />
                <ScalarProperty Name="Indefinite" ColumnName="Indefinite" />
                <ScalarProperty Name="DateOfExpiry" ColumnName="DateOfExpiry" />
                <ScalarProperty Name="DateOfIssue" ColumnName="DateOfIssue" />
                <ScalarProperty Name="CertificateNumber" ColumnName="CertificateNumber" />
                <ScalarProperty Name="IssueNumber" ColumnName="IssueNumber" />
                <ScalarProperty Name="OperatingLicenceNumber" ColumnName="OperatingLicenceNumber" />
                <ScalarProperty Name="NameOnLicence" ColumnName="NameOnLicence" />
                <ScalarProperty Name="ModeID" ColumnName="ModeID" />
                <ScalarProperty Name="VehicleID" ColumnName="VehicleID" />
                <ScalarProperty Name="MemberID" ColumnName="MemberID" />
                <ScalarProperty Name="LicenceStatusID" ColumnName="LicenceStatusID" />
                <ScalarProperty Name="ApplicationRequestDetailID" ColumnName="ApplicationRequestDetailID" />
                <ScalarProperty Name="LicenceID" ColumnName="LicenceID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="Members">
            <EntityTypeMapping TypeName="Model.Member">
              <MappingFragment StoreEntitySet="Members">
                <ScalarProperty Name="BusinessTypeID" ColumnName="BusinessTypeID" />
                <ScalarProperty Name="NeoID" ColumnName="NeoID" />
                <ScalarProperty Name="LtpsID" ColumnName="LtpsID" />
                <ScalarProperty Name="OlasID" ColumnName="OlasID" />
                <ScalarProperty Name="MemberStatusID" ColumnName="MemberStatusID" />
                <ScalarProperty Name="TradeName" ColumnName="TradeName" />
                <ScalarProperty Name="SARSReasonIfNoTaxNumber" ColumnName="SARSReasonIfNoTaxNumber" />
                <ScalarProperty Name="SARSIncomeTaxNumber" ColumnName="SARSIncomeTaxNumber" />
                <ScalarProperty Name="Email" ColumnName="Email" />
                <ScalarProperty Name="TelFax" ColumnName="TelFax" />
                <ScalarProperty Name="TelCell" ColumnName="TelCell" />
                <ScalarProperty Name="TelPhone" ColumnName="TelPhone" />
                <ScalarProperty Name="PhysicalAddressCode" ColumnName="PhysicalAddressCode" />
                <ScalarProperty Name="PhysicalAddress" ColumnName="PhysicalAddress" />
                <ScalarProperty Name="PostalAddressCode" ColumnName="PostalAddressCode" />
                <ScalarProperty Name="PostalAddress" ColumnName="PostalAddress" />
                <ScalarProperty Name="IDNumberOrBusinessRegistrationNo" ColumnName="IDNumberOrBusinessRegistrationNo" />
                <ScalarProperty Name="IDTypeDescription" ColumnName="IDTypeDescription" />
                <ScalarProperty Name="IDTypeID" ColumnName="IDTypeID" />
                <ScalarProperty Name="FirstNames" ColumnName="FirstNames" />
                <ScalarProperty Name="SurnameOrCompanyName" ColumnName="SurnameOrCompanyName" />
                <ScalarProperty Name="TaxClearanceCertificateDocID" ColumnName="TaxClearanceCertificateDocID" />
                <ScalarProperty Name="IdentityDocumentDocID" ColumnName="IdentityDocumentDocID" />
                <ScalarProperty Name="FullName" ColumnName="FullName" />
                <ScalarProperty Name="ReferenceNumber" ColumnName="ReferenceNumber" />
                <ScalarProperty Name="MemberID" ColumnName="MemberID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="DocumentTypes">
            <EntityTypeMapping TypeName="Model.DocumentType">
              <MappingFragment StoreEntitySet="DocumentTypes">
                <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
                <ScalarProperty Name="IsDocumentTitleEditable" ColumnName="IsDocumentTitleEditable" />
                <ScalarProperty Name="IsDocumentTemplate" ColumnName="IsDocumentTemplate" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="DocumentTypeID" ColumnName="DocumentTypeID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_LicenceExtensionPostSaveProcess" FunctionName="LicenceExtensionModel.Store.Pr_LicenceExtensionPostSaveProcess" />
          <FunctionImportMapping FunctionImportName="Pr_LicenceExtensionCheckSecurity" FunctionName="LicenceExtensionModel.Store.Pr_LicenceExtensionCheckSecurity" />
          <EntitySetMapping Name="Vw_LicenceUpliftmentExtensionRequestDetails">
            <EntityTypeMapping TypeName="Model.Vw_LicenceUpliftmentExtensionRequestDetails">
              <MappingFragment StoreEntitySet="Vw_LicenceUpliftmentExtensionRequestDetails">
                <ScalarProperty Name="WorkflowInstanceStatusID" ColumnName="WorkflowInstanceStatusID" />
                <ScalarProperty Name="MemberCell" ColumnName="MemberCell" />
                <ScalarProperty Name="MemberIDNumber" ColumnName="MemberIDNumber" />
                <ScalarProperty Name="MemberTaxReference" ColumnName="MemberTaxReference" />
                <ScalarProperty Name="MemberFullName" ColumnName="MemberFullName" />
                <ScalarProperty Name="CertificateNumber" ColumnName="CertificateNumber" />
                <ScalarProperty Name="SurnameOrCompanyName" ColumnName="SurnameOrCompanyName" />
                <ScalarProperty Name="LicenceUpliftmentReferenceNumber" ColumnName="LicenceUpliftmentReferenceNumber" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="VerifiedLicenceID" ColumnName="VerifiedLicenceID" />
                <ScalarProperty Name="LicenceUpliftmentExtensionRequestDetailID" ColumnName="LicenceUpliftmentExtensionRequestDetailID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          </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="CodeGenerationStrategy" Value="None" />
        <DesignerProperty Name="UseLegacyProvider" Value="False" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="LicenceExtensionModel" ZoomLevel="74">
        <EntityTypeShape EntityType="Model.LicenceUpliftmentExtensionRequestDetail" Width="3.125" PointX="11.625" PointY="2" />
        <EntityTypeShape EntityType="Model.LicenceUpliftmentExtensionRequestDocument" Width="1.5" PointX="15.375" PointY="2.5" />
        <EntityTypeShape EntityType="Model.Licence" Width="1.5" PointX="8" PointY="1" />
        <EntityTypeShape EntityType="Model.Member" Width="1.5" PointX="3.5" PointY="0.625" />
        <AssociationConnector Association="Model.FK_LicenceUpliftmentExtensionRequestDetails_Licences" />
        <AssociationConnector Association="Model.FK_LicenceUpliftmentExtensionRequestDocuments_LicenceUpliftmentExtensionRequestDetails" />
        <AssociationConnector Association="Model.FK_Licences_Members" />
        <EntityTypeShape EntityType="Model.DocumentType" Width="1.5" PointX="0.75" PointY="0.875" />
        <AssociationConnector Association="Model.FK_LicenceUpliftmentExtensionRequestDocuments_DocumentTypes" />
        <EntityTypeShape EntityType="Model.Vw_LicenceUpliftmentExtensionRequestDetails" Width="1.5" PointX="0.75" PointY="5.125" />
      </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>