public void Should_Return_Valid_Result_Stream()
        {
            WorkRelationTerms TEST_CONTRACT_TYPE = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkHealthTerms TEST_HEALTH_TYPE = WorkHealthTerms.HEALTH_TERM_EMPLOYMENT;

            WorkSocialTerms TEST_SOCIAL_TYPE = WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT;

            ITargetValues contractValues = TargetValueBuilder.CreateContractEmplTermValues(
                TEST_CONTRACT_TYPE, TEST_HEALTH_TYPE, TEST_SOCIAL_TYPE, null, null);

            ITargetValues positionValues = TargetValueBuilder.CreatePositionEmplTermValues(null, null);

            ITargetValues positionSalary = TargetValueBuilder.CreateSalaryBaseValues(10000m);

            ITargetValues emptyValues = TargetValueBuilder.CreateEmptyValues();

            ITargetStream targets = TargetStream.CreateEmptyStream().
                                    AddNewContractsTarget(ConfigSetCzArticleName.REF_CONTRACT_EMPL_TERM, contractValues, testConfig).
                                    AddNewPositionsTarget(ConfigSetCzArticleName.REF_POSITION_EMPL_TERM, positionValues, testConfig).
                                    AddTargetIntoPosition(ConfigSetCzArticleName.REF_SALARY_BASE, positionSalary, testConfig).
                                    AddTargetIntoPosition(ConfigSetCzArticleName.REF_INCOME_GROSS, emptyValues, testConfig);

            IEngineProfile testProfile = testEngine.BuildEngineProfile(testPeriod);

            IProcessService testModule = ProcessServiceModule.CreateModule(targets, testConfig, testProfile, serviceLog);

            IResultStream results = testModule.EvaluateTargetsToResults();

            serviceLog.CloseLogStream();

            Assert.AreEqual(0, results.Results().Keys.Count);
        }
Exemplo n.º 2
0
 public DeclarationHealthValue(Byte statement, WorkHealthTerms summarize, TAmountDec totalBase, Byte foreigner) : base((ResultCode)ArticleResultCode.RESULT_VALUE_DECLARATION_HEALTH)
 {
     this.StatementType = statement;
     this.SummarizeType = summarize;
     this.ForeignerType = foreigner;
     this.HealthAnnuity = totalBase;
 }
        public IArticleResult AddDeclarationHealthValue(Byte statement, WorkHealthTerms summarize, TAmountDec totalBase, Byte foreigner)
        {
            IArticleResultValues value = new DeclarationHealthValue(statement, summarize, totalBase, foreigner);

            ResultValues = ResultValues.Concat(value);

            return(this);
        }
        public IArticleResult AddIncomeInsHealthValue(WorkHealthTerms summarize, TAmountDec related, TAmountDec exclude)
        {
            IArticleResultValues value = new IncomeInsHealthValue(summarize, related, exclude);

            ResultValues = ResultValues.Concat(value);

            return(this);
        }
Exemplo n.º 5
0
 public static ITargetValues CreateContractEmplTermValues(WorkRelationTerms contract,
                                                          WorkHealthTerms healthType, WorkSocialTerms socialType,
                                                          DateTime?dateFrom, DateTime?dateEnds)
 {
     return(new TargetValues(contract, healthType, socialType,
                             dateFrom, dateEnds, NULL_TIME_WEEKLY, NULL_DAYS_WEEKLY, NULL_TIME_WORKED, NULL_TIME_ABSENT,
                             NULL_AMOUNT_MONTHLY,
                             NULL_CODE_INTERESTS, NULL_CODE_RESIDENCY, NULL_CODE_MANDATORY, NULL_CODE_STATEMENT, NULL_CODE_HANDICAPS, NULL_CODE_CARDINALS));
 }
Exemplo n.º 6
0
        public TAmountDec ExcludeGeneralIncomes(Period evalPeriod, WorkHealthTerms summarize,
                                                TAmountDec includeIncome, TAmountDec excludeIncome)
        {
            TAmountDec totalIncome = decimal.Zero;

            switch (summarize)
            {
            case WorkHealthTerms.HEALTH_TERM_EMPLOYMENT:
            case WorkHealthTerms.HEALTH_TERM_AGREE_WORK:
            case WorkHealthTerms.HEALTH_TERM_AGREE_TASK:
            case WorkHealthTerms.HEALTH_TERM_OUT_EMPLOY:
                totalIncome = decimal.Add(totalIncome, excludeIncome);
                break;
            }
            return(totalIncome);
        }
        public void Should_return_FALSE_for_Participation_when_WorkTerm_is_AgreementTasks_and_Income_is_9_999_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_CONTRACTER_T;

            WorkHealthTerms termOfHealth = WorkHealthTerms.HEALTH_TERM_AGREE_TASK;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 9999m;
            decimal testTotalTaxIncome = 9999m;

            bool resultValue = engine.ParticipateHealthIncome(testPeriod,
                                                              termOfWork, termOfHealth, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(false, resultValue);
        }
        public void Should_return_TRUE_for_Participation_when_WorkTerm_is_AgreementWorks_and_Income_is_2_500_CZK()
        {
            IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines();

            IHealthEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkHealthTerms termOfHealth = WorkHealthTerms.HEALTH_TERM_AGREE_WORK;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 2500m;
            decimal testTotalTaxIncome = 2500m;

            bool resultValue = engine.ParticipateHealthIncome(testPeriod,
                                                              termOfWork, termOfHealth, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(true, resultValue);
        }
        private void CopyTargetsToResults(ITargetValues targetValues)
        {
            if (targetValues == null)
            {
                return;
            }

            __contractType = targetValues.ContractType();

            __healthWorkType = targetValues.HealthWorkType();

            __socialWorkType = targetValues.SocialWorkType();

            __dateFrom = targetValues.DateFrom();

            __dateEnds = targetValues.DateEnds();

            __timesheetWeekly = targetValues.TimesheetWeekly();

            __workdaysWeekly = targetValues.WorkdaysWeekly();

            __timesheetWorked = targetValues.TimesheetWorked();

            __timesheetAbsent = targetValues.TimesheetAbsent();

            __amountMonthly = targetValues.AmountMonthly();

            __codeInterests = targetValues.CodeInterests();

            __codeResidency = targetValues.CodeResidency();

            __codeMandatory = targetValues.CodeMandatory();

            __codeStatement = targetValues.CodeStatement();

            __codeHandicaps = targetValues.CodeHandicaps();

            __codeCardinals = targetValues.CodeCardinals();
        }
Exemplo n.º 10
0
        public TargetValues(WorkRelationTerms contract, WorkHealthTerms healthType, WorkSocialTerms socialType,
                            DateTime?dateFrom, DateTime?dateEnds, Int32 timeWeekly, Int32 daysWeekly, Int32 timeWorked, Int32 timeAbsent,
                            decimal amountMonthly, uint interests, uint residency, uint mandatory, uint statement, uint handicaps, uint cardinals)
        {
            __contractType = contract;

            __healthWorkType = healthType;

            __socialWorkType = socialType;

            __dateFrom = dateFrom;

            __dateEnds = dateEnds;

            __timesheetWeekly = timeWeekly;

            __workdaysWeekly = daysWeekly;

            __timesheetWorked = timeWorked;

            __timesheetAbsent = timeAbsent;

            __amountMonthly = amountMonthly;

            __codeInterests = interests;

            __codeResidency = residency;

            __codeMandatory = mandatory;

            __codeStatement = statement;

            __codeHandicaps = handicaps;

            __codeCardinals = cardinals;
        }
 public InsDeclarationHealthSource()
 {
     StatementType = 0;
     SummarizeType = WorkHealthTerms.HEALTH_TERM_EMPLOYMENT;
 }
 public abstract bool ParticipateHealthIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkHealthTerms healthTerm,
                                              decimal contractIncome, decimal workTermIncome, decimal totalInsIncome);
        // Participation Selectors

        public bool PartakeHealthIncome(Period period, WorkEmployTerms employTerm, WorkHealthTerms healthTerm,
                                        decimal contracterIncome, decimal employmentIncome, decimal summaryIncome)
        {
            return(true);
        }
 public InsDeclarationHealthSource(Byte statementType, WorkHealthTerms summarizeType, TAmountDec totalYearBase)
 {
     StatementType = statementType;
     SummarizeType = summarizeType;
     TotalYearBase = totalYearBase;
 }
 public override bool ParticipateHealthIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkHealthTerms healthTerm,
                                              decimal contractIncome, decimal workTermIncome, decimal totalInsIncome)
 {
     return(true);
 }
Exemplo n.º 16
0
        public override bool ParticipateHealthIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkHealthTerms healthTerm,
                                                     decimal contractIncome, decimal workTermIncome, decimal totalInsIncome)
        {
            bool workTermAgreementTasks = (workTerm == WorkRelationTerms.WORKTERM_CONTRACTER_T);

            if (workTermAgreementTasks)
            {
                return(ParticipateAgreementTasks(period, contractIncome, workTermIncome, totalInsIncome));
            }
            else
            {
                switch (healthTerm)
                {
                case WorkHealthTerms.HEALTH_TERM_EMPLOYMENT:
                    return(ParticipateEmployment(period, contractIncome, workTermIncome, totalInsIncome));

                case WorkHealthTerms.HEALTH_TERM_AGREE_WORK:
                case WorkHealthTerms.HEALTH_TERM_AGREE_TASK:
                case WorkHealthTerms.HEALTH_TERM_OUT_EMPLOY:
                    return(ParticipateOutOfEmployment(period, contractIncome, workTermIncome, totalInsIncome));

                default:
                    return(true);
                }
            }
        }
Exemplo n.º 17
0
 public IncomeInsHealthValue(WorkHealthTerms summarize, TAmountDec realted, TAmountDec exclude) : base((ResultCode)ArticleResultCode.RESULT_VALUE_INCOME_SUM_HEALTH)
 {
     this.SummarizeType = summarize;
     this.IncomeRelated = realted;
     this.IncomeExclude = exclude;
 }
 public InsDeclarationHealthSource(Byte statementType, WorkHealthTerms summarizeType)
 {
     StatementType = statementType;
     SummarizeType = summarizeType;
 }