erDiagram
    PAYPERIOD {
        Id Guid
        PayrollId Guid
        StartDate Date
        EndDate Date
        PayDate Date
    }
    PAYRUN {
        Id Guid
        PayPeriodId Guid
        PaymentDate Date
        IsMainRun Boolean
        StateName String
    }
    PAYROLL {
        Id Guid
        Name String
        Frequency String
    }
    PAYSLIPITEMGROUP {
        Code String
        Name String
    }
    EMPLOYEE {
        Id Guid
        PersonOnPayrollId Guid
        Name String
        PersonalReference String
        StartDate Date
        PaymentMethod String
    }
    RECONCILIATION {
        Id Guid
        Name String
        PensionName String
        ComparisonPayRunId Guid
        IsTotal Boolean
        SortOrderNumber Int32
        SortOrderGroup Int32
        ComparisonValue Decimal
        Value Decimal
        AdjustmentsValue Decimal
        DifferenceValue Decimal
        DifferencePercent Int32
        ComparisonYTDValue Decimal
        YTDValue Decimal
        ItemId String
    }
    RECONCILIATIONEMPLOYEEPAYRUNVALUE {
        Id Guid
        ComparisonPayRunId Guid
        SortOrderGroup Int32
        SortOrderNumber Int32
        ItemId Guid
        FirstName String
        LastName String
        PensionName String
        Name String
        PersonalReference String
        PersonSocialSecurityNumber String
        Department String
        Location String
        FinanceReferenceNumber String
        JobTitle String
        StartDate Date
        LeaveDate Date
        Item String
        Value Decimal
        ComparisonValue Decimal
        AdjustmentsValue Decimal
        DifferenceValue Decimal
        DifferencePercent Int32
        ComparisonYTDValue Decimal
        YTDValue Decimal
        PaymentMethod String
        Payroll String
        PaymentDate Date
        ComparisonPaymentDate Date
    }
    PERSONONPAYROLLINPERIODUKLEGISLATION {
        Id Guid
        PaymentDate Date
        PayrollReferenceNumber String
        TaxCode String
        TaxBasis Boolean
        NICategory String
    }
    PERSONONPAYROLLPENDINGCALCULATIONTOTAL {
        Id Guid
        Name String
        PersonOnPayrollIdCount Int32
    }
    PAYRUNEMPLOYEEDATASUMMARY {
        Id Guid
        Name String
        PersonalReference String
        StartDate Date
        LeaveDate Date
        Item String
        Value Decimal
        ItemId Guid
        PaymentMethod String
        Firstname String
        Lastname String
    }
    RECONCILIATIONEMPLOYEEPAYRUNITEM {
        Id Guid
        ComparisonPayRunId Guid
        Item String
        ItemId Guid
        Value Decimal
        ComparisonValue Decimal
    }
    RECONCILIATIONEMPLOYEEPAYRUNJOBTITLE {
        Id Guid
        ComparisonPayRunId Guid
        JobTitle String
    }
    EMPLOYEEPAYRUNVALUE {
        Id Guid
        PayRunId Guid
        PayslipItemGroupCode String
        EmployeeId Guid
        PotType String
        Discriminator String
        Tag String
        PayslipItemDefinitionRuleType String
        Value Decimal
    }
    EMPLOYEEINPAYRUN {
        Id Guid
        EmployeeId Guid
        JobTitle String
        PayRunId Guid
    }
    RECONCILIATIONEMPLOYEEPAYRUNDEPARTMENT {
        Id Guid
        ComparisonPayRunId Guid
        Department String
    }
    RECONCILIATIONEMPLOYEEPAYRUNLOCATION {
        Id Guid
        ComparisonPayRunId Guid
        Location String
    }
    EXPENSECLAIMINPERIOD {
        Id Guid
        PersonRef String
        PersonName String
        Department String
        FRN String
        PayslipItem String
        PaymentDate Date
        CreatedDateTime DateTimeOffset
        EarnedDate Date
        Comments String
        Units Decimal
        Time Decimal
        Rate Decimal
        Cash Decimal
        CreatedBySystemUserName String
        AuthorisedBy String
        ApprovalDateTime DateTimeOffset
        Payroll String
    }
    RECONCILIATIONFRNPAYRUNITEM {
        Id Guid
        ComparisonPayRunId Guid
        FinanceReferenceNumber String
        Item String
        PensionName String
        Value Decimal
        ComparisonValue Decimal
        DifferenceValue Decimal
        DifferencePercent Int32
        ItemId Guid
    }
    RECONCILIATIONLOCATIONPAYRUNITEM {
        Id Guid
        ComparisonPayRunId Guid
        Location String
        Item String
        ItemId Guid
        PensionName String
        SortOrderNumber Int32
        SortOrderGroup Int32
        Value Decimal
        ComparisonValue Decimal
        DifferenceValue Decimal
        DifferencePercent Int32
    }
    RECONCILIATIONEMPLOYEEPAYRUNFRN {
        Id Guid
        ComparisonPayRunId Guid
        FinanceReferenceNumber String
    }
    PAYPERIODVALUE {
        Id Guid
        PayPeriodId Guid
        PayslipItemGroupCode String
        PotType String
        Discriminator String
        Tag String
        PayslipItemDefinitionRuleType String
        Value Decimal
    }
    EMPLOYEEPERIODVALUE {
        Id Guid
        PayPeriodId Guid
        PayslipItemGroupCode String
        EmployeeId Guid
        PotType String
        Discriminator String
        Tag String
        PayslipItemDefinitionRuleType String
        Value Decimal
    }
    EMPLOYEEINPAYPERIOD {
        Id Guid
        EmployeeId Guid
        PayPeriodId Guid
    }
    PAYRUNVALUE {
        Id Guid
        PayRunId Guid
        PayslipItemGroupCode String
        PotType String
        Discriminator String
        Tag String
        PayslipItemDefinitionRuleType String
        Value Decimal
        LegislativeConfiguration String
    }
    OCCUPANCY {
        Id Guid
        PersonId Guid
        StartDate Date
        EndDate Date
    }
    OCCUPANCYTITLEREVISION {
        Id Guid
        OccupancyId Guid
        Title String
        StartDate Date
    }
    Resource_Paths {
        PayPeriods URL
        PayRuns URL
        Payrolls URL
        PayslipItemGroups URL
        People URL
        Reconciliations URL
        ReconciliationEmployeePayRunValues URL
        PersonOnPayrollInPeriodUKLegislations URL
        PersonOnPayrollPendingCalculationTotals URL
        PayRunEmployeeDataSummaries URL
        ReconciliationEmployeePayRunItems URL
        ReconciliationEmployeePayRunJobTitles URL
        EmployeePayRunValues URL
        EmployeesInPayRun URL
        ReconciliationEmployeePayRunDepartments URL
        ReconciliationEmployeePayRunLocations URL
        ExpenseClaimsInPeriod URL
        ReconciliationFrnPayRunItems URL
        ReconciliationLocationPayRunItems URL
        ReconciliationEmployeePayRunFrns URL
    }
    PAYPERIOD o{--|| PAYROLL : Payroll
    PAYRUN o{--|| PAYPERIOD : PayPeriod
    EMPLOYEEPAYRUNVALUE o{--|| PAYRUN : PayRun
    EMPLOYEEPAYRUNVALUE o{--|| PAYSLIPITEMGROUP : PayslipItemGroup
    EMPLOYEEPAYRUNVALUE o{--|| EMPLOYEE : Employee
    EMPLOYEEINPAYRUN o{--|| EMPLOYEE : Employee
    EMPLOYEEINPAYRUN o{--|| PAYRUN : PayRun
    PAYPERIODVALUE o{--|| PAYPERIOD : PayPeriod
    PAYPERIODVALUE o{--|| PAYSLIPITEMGROUP : PayslipItemGroup
    EMPLOYEEPERIODVALUE o{--|| PAYPERIOD : PayPeriod
    EMPLOYEEPERIODVALUE o{--|| PAYSLIPITEMGROUP : PayslipItemGroup
    EMPLOYEEPERIODVALUE o{--|| EMPLOYEE : Employee
    EMPLOYEEINPAYPERIOD o{--|| EMPLOYEE : Employee
    EMPLOYEEINPAYPERIOD o{--|| PAYPERIOD : PayPeriod
    PAYRUNVALUE o{--|| PAYRUN : PayRun
    PAYRUNVALUE o{--|| PAYSLIPITEMGROUP : PayslipItemGroup
    OCCUPANCY o{--|| EMPLOYEE : Employee
    OCCUPANCYTITLEREVISION o{--|| OCCUPANCY : Occupancy