-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge cdecc0a into feature/238__rdMigrationRemoveTotal
- Loading branch information
Showing
260 changed files
with
32,986 additions
and
238 deletions.
There are no files selected for viewing
128 changes: 128 additions & 0 deletions
128
force-app/infrastructure/apex-common/main/classes/fflib_Application.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/** | ||
* Copyright (c), FinancialForce.com, inc | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* - Neither the name of the FinancialForce.com, inc nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
|
||
/** | ||
* Class provides inner classes implementing factories for the main components | ||
* of the Apex Enterprise Patterns, Service, Unit Of Work, Selector and Domain. | ||
* See the sample applications Application.cls file for an example | ||
**/ | ||
public virtual class fflib_Application | ||
{ | ||
/** | ||
* Class implements a Unit of Work factory | ||
**/ | ||
public virtual class UnitOfWorkFactory | ||
{ | ||
private List<SObjectType> m_objectTypes; | ||
private fflib_ISObjectUnitOfWork m_mockUow; | ||
|
||
/** | ||
* Constructs a Unit Of Work factory | ||
**/ | ||
public UnitOfWorkFactory() { } | ||
|
||
/** | ||
* Constructs a Unit Of Work factory | ||
* | ||
* @param objectTypes List of SObjectTypes in dependency order | ||
**/ | ||
public UnitOfWorkFactory(List<SObjectType> objectTypes) | ||
{ | ||
m_objectTypes = objectTypes.clone(); | ||
} | ||
|
||
/** | ||
* Returns a new fflib_SObjectUnitOfWork configured with the | ||
* SObjectType list provided in the constructor, returns a Mock implementation | ||
* if set via the setMock method | ||
**/ | ||
public virtual fflib_ISObjectUnitOfWork newInstance() | ||
{ | ||
// Mock? | ||
if(m_mockUow!=null) | ||
return m_mockUow; | ||
return new fflib_SObjectUnitOfWork(m_objectTypes); | ||
} | ||
|
||
/** | ||
* Returns a new fflib_SObjectUnitOfWork configured with the | ||
* SObjectType list provided in the constructor, returns a Mock implementation | ||
* if set via the setMock method | ||
**/ | ||
public virtual fflib_ISObjectUnitOfWork newInstance(fflib_SObjectUnitOfWork.IDML dml) | ||
{ | ||
// Mock? | ||
if(m_mockUow!=null) | ||
return m_mockUow; | ||
return new fflib_SObjectUnitOfWork(m_objectTypes, dml); | ||
} | ||
|
||
/** | ||
* Returns a new fflib_SObjectUnitOfWork configured with the | ||
* SObjectType list specified, returns a Mock implementation | ||
* if set via the setMock method | ||
* | ||
* @remark If mock is set, the list of SObjectType in the mock could be different | ||
* then the list of SObjectType specified in this method call | ||
**/ | ||
public virtual fflib_ISObjectUnitOfWork newInstance(List<SObjectType> objectTypes) | ||
{ | ||
// Mock? | ||
if(m_mockUow!=null) | ||
return m_mockUow; | ||
return new fflib_SObjectUnitOfWork(objectTypes); | ||
} | ||
|
||
/** | ||
* Returns a new fflib_SObjectUnitOfWork configured with the | ||
* SObjectType list specified, returns a Mock implementation | ||
* if set via the setMock method | ||
* | ||
* @remark If mock is set, the list of SObjectType in the mock could be different | ||
* then the list of SObjectType specified in this method call | ||
**/ | ||
public virtual fflib_ISObjectUnitOfWork newInstance(List<SObjectType> objectTypes, fflib_SObjectUnitOfWork.IDML dml) | ||
{ | ||
// Mock? | ||
if(m_mockUow!=null) | ||
return m_mockUow; | ||
return new fflib_SObjectUnitOfWork(objectTypes, dml); | ||
} | ||
|
||
@TestVisible | ||
protected virtual void setMock(fflib_ISObjectUnitOfWork mockUow) | ||
{ | ||
m_mockUow = mockUow; | ||
} | ||
} | ||
|
||
public class ApplicationException extends Exception { } | ||
|
||
/** | ||
* Exception representing a developer coding error, not intended for end user eyes | ||
**/ | ||
public class DeveloperException extends Exception { } | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
force-app/infrastructure/apex-common/main/classes/fflib_IDomainConstructor.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c), FinancialForce.com, inc | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* - Neither the name of the FinancialForce.com, inc nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
public interface fflib_IDomainConstructor | ||
{ | ||
fflib_IDomain construct(List<Object> objects); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
force-app/infrastructure/apex-common/main/classes/fflib_IObjects.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>53.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
38 changes: 38 additions & 0 deletions
38
force-app/infrastructure/apex-common/main/classes/fflib_ISObjectDomain.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright (c), FinancialForce.com, inc | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* - Neither the name of the FinancialForce.com, inc nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
|
||
public interface fflib_ISObjectDomain extends fflib_IDomain | ||
{ | ||
/** | ||
* Returns the SObjectType this Domain class represents | ||
**/ | ||
Schema.SObjectType sObjectType(); | ||
|
||
/** | ||
* Alternative to the Records property, provided to support mocking of Domain classes | ||
**/ | ||
List<SObject> getRecords(); | ||
} |
5 changes: 5 additions & 0 deletions
5
force-app/infrastructure/apex-common/main/classes/fflib_ISObjectDomain.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>53.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
38 changes: 38 additions & 0 deletions
38
force-app/infrastructure/apex-common/main/classes/fflib_ISObjectSelector.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright (c), FinancialForce.com, inc | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* - Neither the name of the FinancialForce.com, inc nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
|
||
public interface fflib_ISObjectSelector | ||
{ | ||
/** | ||
* Provides the SObjectType for the object the given Selector is providing query logic for | ||
**/ | ||
Schema.SObjectType sObjectType(); | ||
|
||
/** | ||
* Selects by Id records using the fields defined by the Selector configuration | ||
**/ | ||
List<SObject> selectSObjectsById(Set<Id> idSet); | ||
} |
5 changes: 5 additions & 0 deletions
5
force-app/infrastructure/apex-common/main/classes/fflib_ISObjectSelector.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>53.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.