Skip to content

Commit

Permalink
Update expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohills-regnosys committed Mar 22, 2024
1 parent 5e70d51 commit 13986a0
Show file tree
Hide file tree
Showing 81 changed files with 2,021 additions and 552 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public List<LegalAgreement> getDocumentation(Path synonymPath) {
}

private Optional<LegalAgreement> getMasterAgreement(Path synonymPath) {
// If synonymPath does not end with "masterAgreement", return an empty Optional
if (!pathExists("masterAgreement")) {
return Optional.empty();
}
Path masterAgreementPath = synonymPath.addElement("masterAgreement");

LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();
Expand Down Expand Up @@ -94,15 +90,14 @@ private Optional<LegalAgreement> getMasterAgreement(Path synonymPath) {
mappings,
rosettaPath);

setContractualParty(builder);
if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.MASTER_AGREEMENT);
}

private Optional<LegalAgreement> getMasterConfirmation(Path synonymPath) {
// If synonymPath does not end with "masterConfirmation", return an empty Optional
if (!pathExists("masterConfirmation")) {
return Optional.empty();
}
Path masterConfirmationPath = synonymPath.addElement("masterConfirmation");

LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();
Expand Down Expand Up @@ -146,30 +141,24 @@ private Optional<LegalAgreement> getMasterConfirmation(Path synonymPath) {
mappings,
rosettaPath);

setContractualParty(builder);
if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.MASTER_CONFIRMATION);

}

private Optional<LegalAgreement> getBrokerConfirmation(Path synonymPath) {
// If synonymPath does not end with "brokerConfirmation", return an empty Optional
if (!pathExists("brokerConfirmation")) {
return Optional.empty();
}

LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();

setContractualParty(builder);
if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.BROKER_CONFIRMATION);
}

private Optional<LegalAgreement> getCreditSupportAgreement(Path synonymPath) {
// If synonymPath does not end with "creditSupportAgreement", return an empty Optional
if (!pathExists("creditSupportAgreement")) {
return Optional.empty();
}
Path creditSupportAgreementPath = synonymPath.addElement("creditSupportAgreement");

LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();
Expand All @@ -196,16 +185,14 @@ private Optional<LegalAgreement> getCreditSupportAgreement(Path synonymPath) {
mappings,
rosettaPath);

setContractualParty(builder);
if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.CREDIT_SUPPORT_AGREEMENT);
}

private Optional<LegalAgreement> getConfirmation(Path synonymPath) {
// If synonymPath does not end with "contractualDefinitions", return an empty Optional
if (!pathExists("contractualDefinitions")) {
return Optional.empty();
}
LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();

filterListMappings(mappings, synonymPath.addElement("contractualDefinitions")).stream()
Expand Down Expand Up @@ -296,7 +283,9 @@ private Optional<LegalAgreement> getConfirmation(Path synonymPath) {
}
});

setContractualParty(builder);
if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.CONFIRMATION);
}
Expand All @@ -307,10 +296,6 @@ private Date parseDate(String xmlValue) {
}

private Optional<LegalAgreement> getOtherAgreement(Path synonymPath) {
// If synonymPath does not end with "otherAgreement", return an empty Optional
if (!pathExists("otherAgreement")) {
return Optional.empty();
}
Path otherAgreementPath = synonymPath.addElement("otherAgreement");

LegalAgreement.LegalAgreementBuilder builder = LegalAgreement.builder();
Expand All @@ -329,7 +314,10 @@ private Optional<LegalAgreement> getOtherAgreement(Path synonymPath) {
xmlValue -> builder.setAgreementDate(parseDate(xmlValue)),
mappings,
rosettaPath);
setContractualParty(builder);

if (builder.hasData()) {
setContractualParty(builder);
}

return setAgreementType(builder, LegalAgreementTypeEnum.OTHER);
}
Expand All @@ -345,15 +333,11 @@ private Optional<LegalAgreement> setAgreementType(LegalAgreement.LegalAgreementB
}
}

private boolean pathExists(String pathEndsWith) {
return mappings.stream()
.anyMatch(m -> m.getXmlPath().endsWith(pathEndsWith));
}

private void setContractualParty(LegalAgreement.LegalAgreementBuilder builder) {
PartyMappingHelper.getInstance(mappingContext).ifPresent(helper -> {
LOGGER.debug("Waiting for counterparties to be collected before updating contractual parties");
// wait until both counterparties have been collected before getting party references
// wait until both counterparties have been collected before getting party references.
// also, add task to invokedTasks so the mapping process does not get shutdown prematurely.
invokedTasks.add(helper.getBothCounterpartiesCollectedFuture().thenAcceptAsync(counterpartyMap -> {
Set<String> counterpartyExternalRefs = counterpartyMap.keySet();
LOGGER.info("Setting contractual party references {}", counterpartyExternalRefs);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade1.xml","excludedPaths":0,"externalPaths":97,"outstandingMappings":5,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade2.xml","excludedPaths":0,"externalPaths":89,"outstandingMappings":7,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"CreditDefaultSwaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade3.xml","excludedPaths":0,"externalPaths":76,"outstandingMappings":5,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade4.xml","excludedPaths":0,"externalPaths":88,"outstandingMappings":5,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade5.xml","excludedPaths":0,"externalPaths":74,"outstandingMappings":5,"validationFailures":10,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade6.xml","excludedPaths":0,"externalPaths":98,"outstandingMappings":6,"validationFailures":11,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}]
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade1.xml","excludedPaths":0,"externalPaths":97,"outstandingMappings":5,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade2.xml","excludedPaths":0,"externalPaths":89,"outstandingMappings":7,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"CreditDefaultSwaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade3.xml","excludedPaths":0,"externalPaths":76,"outstandingMappings":5,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade4.xml","excludedPaths":0,"externalPaths":88,"outstandingMappings":5,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade5.xml","excludedPaths":0,"externalPaths":74,"outstandingMappings":5,"validationFailures":8,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/dtcc-11-0/DDL_NewTrade6.xml","excludedPaths":0,"externalPaths":98,"outstandingMappings":6,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}]
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex14-long-emlatin-corp-fixreg.xml","excludedPaths":0,"externalPaths":87,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex15-long-emlatin-sov-fixreg.xml","excludedPaths":0,"externalPaths":83,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex16-short-us-corp-fixreg-recovery-factor.xml","excludedPaths":0,"externalPaths":40,"outstandingMappings":4,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex17-short-us-corp-portfolio-compression.xml","excludedPaths":0,"externalPaths":44,"outstandingMappings":8,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex18-standard-north-american-corp.xml","excludedPaths":0,"externalPaths":42,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex17-short-us-corp-portfolio-compression.xml","excludedPaths":0,"externalPaths":44,"outstandingMappings":4,"validationFailures":0,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex18-standard-north-american-corp.xml","excludedPaths":0,"externalPaths":42,"outstandingMappings":2,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-ex19-cdx-index-option-pred-clearing.xml","excludedPaths":0,"externalPaths":82,"outstandingMappings":11,"validationFailures":0,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"CreditDefaultSwaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-indamt-ex01-short-us-corp-fixreg.xml","excludedPaths":0,"externalPaths":44,"outstandingMappings":5,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-swaption-1.xml","excludedPaths":0,"externalPaths":98,"outstandingMappings":12,"validationFailures":0,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"CreditDefaultSwaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cd-swaption-2.xml","excludedPaths":0,"externalPaths":118,"outstandingMappings":12,"validationFailures":0,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_SingleName","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"CreditDefaultSwaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex01-cdx.xml","excludedPaths":0,"externalPaths":32,"outstandingMappings":2,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex02-iTraxx.xml","excludedPaths":0,"externalPaths":30,"outstandingMappings":0,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex03-iTraxx-contractual-supplement.xml","excludedPaths":0,"externalPaths":44,"outstandingMappings":5,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex03-iTraxx-contractual-supplement.xml","excludedPaths":0,"externalPaths":44,"outstandingMappings":2,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex04-iBoxx.xml","excludedPaths":0,"externalPaths":41,"outstandingMappings":2,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex05-SP.xml","excludedPaths":0,"externalPaths":42,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cds-ELCDS-ReferenceObligation.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":12,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Loan","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cdindex-ex05-SP.xml","excludedPaths":0,"externalPaths":42,"outstandingMappings":3,"validationFailures":3,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Index","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cds-ELCDS-ReferenceObligation.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":10,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Loan","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cds-basket-tranche.xml","excludedPaths":0,"externalPaths":76,"outstandingMappings":17,"validationFailures":3,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Basket","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cds-basket.xml","excludedPaths":0,"externalPaths":73,"outstandingMappings":17,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Basket","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/credit-derivatives/cds-custom-basket.xml","excludedPaths":0,"externalPaths":115,"outstandingMappings":24,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"CreditDefaultSwap_Basket","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
Expand Down
Loading

0 comments on commit 13986a0

Please sign in to comment.