apex-enterprise-patterns / fflib-apex-common-samplecode

Samples application illustrating the Apex Enterprise Patterns library
BSD 3-Clause "New" or "Revised" License
205 stars 105 forks source link

Typo? #17

Closed antonyxuan closed 6 years ago

antonyxuan commented 6 years ago

https://github.com/financialforcedev/fflib-apex-common-samplecode/blob/a400ac2348dc3c33ab9a4e68617f7ff2b59153d1/fflib-sample-code/src/classes/Opportunities.cls#L142

should this be 'this.discountPercentage' instead of 'this, discountPercentage'?

stohn777 commented 6 years ago

@antonyxuan The sample code is correct as currently in the repo.

The OpportunityLineItem, ApplyDiscount method (line 35; see below) expects 3 parameters -- IOpportunities, Decimal, fflib_ISObjectUnitOfWork. In the sample usage, this is the instance of the wrapping class which contains the Opportunity records to be processed, discountPercentage a Decimal variable containing the fractional amount by which the unit price will be adjusted, and uow the FFLIB unit of work instance (which was supplied to the wrapping method) that will store the Opportunity records that will be updated.

https://github.com/financialforcedev/fflib-apex-common-samplecode/blob/a400ac2348dc3c33ab9a4e68617f7ff2b59153d1/fflib-sample-code/src/classes/OpportunityLineItems.cls#L35

Regards.

antonyxuan commented 6 years ago

Thanks @stohn777 , you are right my mistake