Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aligning DB contract table with domain.ActiveContract class #3989

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

leo-da
Copy link
Contributor

@leo-da leo-da commented Jan 8, 2020

Closes: #3754

  • Add: key, signatories, observers and agreement_text to DB contract table
  • Remove: witnessParties

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@leo-da leo-da marked this pull request as ready for review January 8, 2020 18:48
@leo-da leo-da requested review from S11001001 and hurryabit January 8, 2020 18:48
@@ -111,13 +111,21 @@ private class ContractsFetch(
for {
ac <- domain.ActiveContract fromLedgerApi ce leftMap (de =>
new IllegalArgumentException(s"contract ${ce.contractId}: ${de.shows}"))
lfKey <- ac.key.cata(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lfKey <- ac.key.cata(
lfKey <- ac.key traverse apiValueToLfValue leftMap (_.cause)

@@ -34,6 +34,7 @@ da_scala_library(
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_tpolecat_doobie_postgres_2_12",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@maven//:org_tpolecat_doobie_postgres_2_12",

Use the same technique used for insertContracts: take Get[Array[String]] as an implicit argument to selectContracts.

adding key,signatories, observers and agreement_text to DB contract table
removing witnessParties

Reading signatories and observers from contracts table

Updating doc, removing witnessParties

Address code review comments, thanks @S11001001

CHANGELOG_BEGIN

[JSON API - Experimental]
- Align ``contract`` table with ``domain.ActiveContract`` class.
  The database schema has changed, if using ``--query-store-jdbc-config``,
  you must rebuild the database by adding ``,createSchema=true``. See #3754.
- ``witnessParties`` field is removed from all JSON responses.

CHANGELOG_END
@leo-da leo-da force-pushed the leo-3754-domain-model-cleanup branch from a6dc267 to 29bcb3e Compare January 8, 2020 19:56
@leo-da leo-da requested a review from S11001001 January 8, 2020 19:57
remove witnessParties and workflowId fields. workflowId has be removed
from JSON output a while ago.
@mergify mergify bot merged commit e75b983 into master Jan 8, 2020
@mergify mergify bot deleted the leo-3754-domain-model-cleanup branch January 8, 2020 20:40
Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the APIs look good to me. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Align http.domain.ActiveContract and http.dbbackend.Queries.DBContract
3 participants