Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs/legal-agreements.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,23 @@ The below snippet represents the `UmbrellaAgreement` data type.

``` Haskell
type UmbrellaAgreement:
isApplicable boolean (1..1)
language string (0..1)
parties UmbrellaAgreementEntity (0..*)
agreementSet UmbrellaAgreementSet (1..*)
```


### Umbrella Agreement Set

`UmbrellaAgreementSet` is a data type used to specify the applicability of
Umbrella Agreement terms, relevant specific language, and underlying
entities associated with the umbrella agreement.

The below snippet represents the `UmbrellaAgreementSet` data type.

``` Haskell
type UmbrellaAgreementSet:
agreement Agreement (1..1)
umbrellaAgreementParty UmbrellaAgreementParty (2..*)
additionalLanguage string (0..1)
```

### Agreement Content
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package cdm.legaldocumentation.common.processor;

import cdm.legaldocumentation.common.Agreement;
import cdm.legaldocumentation.common.UmbrellaAgreement.UmbrellaAgreementBuilder;
import cdm.legaldocumentation.common.UmbrellaAgreementParty;
import cdm.legaldocumentation.common.UmbrellaAgreementSet;
import com.regnosys.rosetta.common.translation.MappingContext;
import com.regnosys.rosetta.common.translation.MappingProcessor;
import com.regnosys.rosetta.common.translation.Path;
import com.rosetta.model.lib.RosettaModelObjectBuilder;
import com.rosetta.model.lib.path.RosettaPath;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import static org.isda.cdm.processor.CdmMappingProcessorUtils.removeHtml;

/**
* CreateiQ mapping processor.
*/
@SuppressWarnings("unused")
public class UmbrellaAgreementSetMappingProcessor extends MappingProcessor {

public UmbrellaAgreementSetMappingProcessor(RosettaPath modelPath, List<Path> synonymPaths, MappingContext mappingContext) {
super(modelPath, synonymPaths, mappingContext);
}

@Override
public void map(Path synonymPath, List<? extends RosettaModelObjectBuilder> builder, RosettaModelObjectBuilder parent) {
UmbrellaAgreementBuilder umbrellaAgreementBuilder = (UmbrellaAgreementBuilder) parent;
umbrellaAgreementBuilder.setAgreementSet(new ArrayList<>());

int index = 0;
while (true) {
//We want to construct an agreementSet that holds party:
//party is part of umbrellaAgreementParty
Optional<UmbrellaAgreementSet> umbrellaAgreementSet = getUmbrellaAgreementSet(synonymPath, index++);
if (umbrellaAgreementSet.isPresent()) {
umbrellaAgreementBuilder.addAgreementSet(umbrellaAgreementSet.get());
} else {
break;
}
}
}

//TODO: finish building the mapper:
private Optional<UmbrellaAgreementSet> getUmbrellaAgreementSet(Path synonymPath, Integer index) {
UmbrellaAgreementSet.UmbrellaAgreementSetBuilder umbrellaAgreementSetBuilder = UmbrellaAgreementSet.builder();

// setValueAndUpdateMappings(synonymPath.addElement("principal_name", index),
// umbrellaAgreementSetBuilder::setNameValue);
//
// setValueAndUpdateMappings(synonymPath.addElement("lei", index),
// value -> umbrellaAgreementSetBuilder.addEntityId(toFieldWithMetaString(value)));
//
// setValueAndUpdateMappings(synonymPath.addElement("additional", index),
// value -> umbrellaAgreementSetBuilder.setTerms(removeHtml(value)));

//aggreement obj
Agreement agreement = getAgreement(synonymPath, index);
setValueAndUpdateMappings(synonymPath.addElement("agreement", index),
value -> umbrellaAgreementSetBuilder.setAgreement(agreement));

//UmbrellaAggreementParty
List<UmbrellaAgreementParty> parties = getUmbrellaAgreementParties(synonymPath, index);
setValueAndUpdateMappings(synonymPath.addElement("agreementParty", index),
value -> {
UmbrellaAgreementParty umbrellaAgreementParty = UmbrellaAgreementParty.builder().build();
umbrellaAgreementSetBuilder.setUmbrellaAgreementParty(parties);
});

//additional_language
setValueAndUpdateMappings(synonymPath.addElement("additionallanguage", index),
value -> umbrellaAgreementSetBuilder.setAdditionalLanguage(removeHtml(value)));


return umbrellaAgreementSetBuilder.hasData() ? Optional.of(umbrellaAgreementSetBuilder.build()) : Optional.empty();
}

private Agreement getAgreement(Path synonymPath, Integer index) {
Agreement agreement = Agreement.builder().build();
return Agreement.builder().build();
}

private List<UmbrellaAgreementParty> getUmbrellaAgreementParties(Path synonymPath, Integer index) {
List<UmbrellaAgreementParty> parties = new ArrayList<>();
UmbrellaAgreementParty umbrellaAgreementParty = UmbrellaAgreementParty.builder().build();
parties.add(umbrellaAgreementParty);
return parties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,11 @@ enum TerminationCurrencyConditionEnum:
FreelyAvailable <"A currency that is freely available.">
PaymentsDueAndFreelyAvailable <"A currency in which payments would be due under one or more Transactions and that is freely available.">
Specified <"Termination Currency Conditions are specified.">

enum UmbrellaPartyRoleEnum:
Agent <"Represents a Legal Entity who has authority to negotiate, execute and deliver confirmations on behalf of each affiliate that is linked to the Agent.">
InvestmentManager <"Represents a Legal Entity who has been authorised to act as a centralised authority empowered to negotiate, execute and manage transactions on behalf of multiple affiliated funds or accounts.">
Principal <"Represents a Legal Entity that enters into and assumes direct responsibility for transactions.">
SubAccount <"Represents an individual trading entity, fund, portfolio or managed account associated to a principal, Investment Manager or Agent Legal Entity.">
Sleeve <"Represents a distinct trading strategy, portfolio, or sub account managed within a broader legal entity or fund. It is not a legal party to the agreement.">

Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ type LegalAgreement extends LegalAgreementBase: <"The specification of a legal a

agreementTerms AgreementTerms (0..1) <"Specification of the content of the legal agreement.">
relatedAgreements LegalAgreement (0..*) <"Specifies the agreement(s) that govern the agreement, either as a reference to such agreements when specified as part of the CDM, or through identification of some of the key terms of those agreements, such as the type of agreement, the publisher, the vintage, the agreement identifier and the agreement date.">
umbrellaAgreement UmbrellaAgreement (0..1) <"The determination of whether Umbrella Agreement terms are applicable (True) or Not Applicable (False).">

umbrellaAgreement UmbrellaAgreement (0..1) <"Specifies a set of legal entities which are part of a legal agreement beyond the two contracting parties to that agreement.">
condition ConsistentlyExecutedAgreements: <"An executed agreement can only point to executed related agreements if any.">
if relatedAgreements exists and agreementDate exists
then relatedAgreements -> agreementDate exists
Expand Down Expand Up @@ -153,18 +153,36 @@ type AgreementName: <"Specifies the agreement name through an agreement type and
if creditSupportAgreementMarginType exists
then creditSupportAgreementType exists

type UmbrellaAgreement: <"A class to specify a set of legal entities which are part of a legal agreement beyond the two contracting parties to that agreement. This data representation reflects the ISDA Create representation.">
type UmbrellaAgreement: <"Specifies a set of parties which are part of a legal agreement beyond the two contracting parties to that agreement.">
agreementSet UmbrellaAgreementSet (1..*) <"The language associated with the umbrella agreement, and which applies to all the parties to the umbrella agreement.">

type UmbrellaAgreementParty: <"Specifies the entities that are part of the umbrella agreement.">
party Party (0..1) <"Specifies the party to the umbrella agreement">
actingAs CounterpartyRoleEnum (0..1) <"Specifies the CounterpartyRoleEnum, e.g. either Party1 or Party2, that is associated to the party.">
umbrellaPartyrole UmbrellaPartyRoleEnum (0..1) <"Represents the legal role that each defined entity to the agreement performs within the structure of that agreement.">
nonLegalEntity NonLegalEntity (0..1) <"Specifies a non legal entity that exists in the agreement with a defined relationship to a Legal entity to the agreement.">
parentParty Party (0..1) <"Represents the identification of a parent child relationship between two entities in the Umbrella agreement, allowing non-legal entities to be linked to the appropriate legal entity and allowing funds, portfolio or managed accounts to be linked to their applicable Investment Manager or Agent within the agreement.">

condition ParentParty: <"Specifies that certain defined roles require that a parent party is identified.">
if umbrellaPartyrole = UmbrellaPartyRoleEnum -> Sleeve then parentParty exists

isApplicable boolean (1..1) <"The determination of whether Umbrella Agreement terms are Applicable (True), or Not Applicable (False)">
language string (0..1) <"The language associated with the umbrella agreement, and which applies to all the parties to the umbrella agreement.">
parties UmbrellaAgreementEntity (0..*) <"Underlying principals to the umbrella agreement.">
condition UmbrellaParty: <"Only a Party or a Non Legal entity can be set.">
optional choice party,nonLegalEntity

condition UmbrellaAgreementExists: <"Umbrella Agreement language and parties should not exist when Umbrella Agreement terms are Not Applicable.">
if isApplicable = True then language exists and parties exists
condition NonLegalEntityParent: <"Non Legal entity must have a Parent Party.">
if nonLegalEntity exists then parentParty exists

type UmbrellaAgreementEntity extends LegalEntity: <"A class to specify the legal entities that are part of the umbrella agreement.">
type NonLegalEntity: <"Specifies a non legal entity that exists in the agreement with a defined relationship to a Legal entity to the agreement">
identifier string (1..1) <"Specifies the unique identifier value for a non legal entity such as a sleeve, or sub account, that is a party to the agreement and has a relationship with a legal entity defined on the agreement.">
identifierType string (1..1) <"Specifies the Identifier type for a non Legal entity to the agreement, for example the use of an alert code to uniquely identify a non Legal entity.">

type UmbrellaAgreementSet: <"Represents the groups of agreement term elections that exist within the agreement and to which entities that particular group of elections apply. Where all entities under the umbrella have the same set of elections only one agreement set will exist. At least one agreement set must be defined for an Umbrella agreement">
agreement Agreement (1..1) <"Specification of the standard set of terms that define a legal agreement.">
umbrellaAgreementParty UmbrellaAgreementParty (2..*) <"Specifies the underlying parties to the agreement that either act as legal parties to the agreement or represent legal constructs that are managed by a party to the agreement but do not represent a Legal Entity as of themselves.">
additionalLanguage string (0..1) <"Represents any additional language that may need to be captured regarding the structure or application of terms that may exist for the agreement.">

terms string (0..1) <"The terms that might be associated with each party to the umbrella agreement.">
condition ExcludeGMSLA: <"Umbrella agreement fn=unctionality is not applicable to the GMSLA legal agreement type">
agreement -> masterAgreementElections -> islaGmsla is absent

type ContactInformationElection: <"Specifies the party reference and the associated contact information.">
partyReference CounterpartyRoleEnum (1..1) <"The party to which the election and details apply.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,10 @@ synonym source CreateiQ_1_0 extends CreateiQ
+ masterAgreementType
[value "documentType"]

UmbrellaAgreement:
+ isApplicable
[set to True when "is_applicable" = "applicable" , set to False when "is_applicable" = "not_applicable"]
+ language
UmbrellaAgreementSet:
+ additionalLanguage
[value "language" maps 2 removeHtml]
+ parties
+ umbrellaAgreementParty
[value "principal_identification_schedule" mapper "UmbrellaAgreementEntity"]

OtherAgreementTerms:
Expand Down
Loading