コード例 #1
0
 private function _calcCompressionOi()
 {
     $req = new CalcCompressOiRequest();
     $req->setQualificationLevelPv(self::QUALIFICATION_PV);
     $req->setQualificationLevelTv(self::QUALIFICATION_TV);
     $resp = $this->_callCalc->compressOi($req);
     $this->assertTrue($resp->isSucceed());
 }
コード例 #2
0
 private function _calcValueTv($nextPeriodBegin, $expectedBegin, $expectedEnd)
 {
     /* perform operation by the first date of the next period */
     $datePerformed = $this->_toolPeriod->getTimestampTo($nextPeriodBegin);
     $request = new BonusCalcTvCompressionRequest();
     $request->setDatePerformed($datePerformed);
     $response = $this->_callCalc->valueTv($request);
     $this->assertTrue($response->isSucceed());
     $periodId = $response->getPeriodId();
     $calcId = $response->getCalcId();
     /* validate period */
     $this->assertNotNull($periodId);
     $data = $this->_repoBasic->getEntityByPk(Period::ENTITY_NAME, [Period::ATTR_ID => $periodId]);
     $this->assertEquals($expectedBegin, $data[Period::ATTR_DSTAMP_BEGIN]);
     $this->assertEquals($expectedEnd, $data[Period::ATTR_DSTAMP_END]);
     /* validate calculation */
     $this->assertNotNull($calcId);
     $data = $this->_repoBasic->getEntityByPk(Calculation::ENTITY_NAME, [Calculation::ATTR_ID => $calcId]);
     $this->assertEquals(Cfg::CALC_STATE_COMPLETE, $data[Calculation::ATTR_STATE]);
 }
コード例 #3
0
 private function _calcValueTv()
 {
     $request = new BonusCalcValueTvRequest();
     $response = $this->_callCalc->valueTv($request);
     $this->assertTrue($response->isSucceed());
 }