Skip to content

feat: add retired information to contract agreement api#380

Draft
ndr-brt wants to merge 1 commit intomainfrom
agreement-performance-poc
Draft

feat: add retired information to contract agreement api#380
ndr-brt wants to merge 1 commit intomainfrom
agreement-performance-poc

Conversation

@ndr-brt
Copy link
Copy Markdown
Collaborator

@ndr-brt ndr-brt commented Feb 26, 2026

What

Adds a /contractagreement/request-enhanced endpoint, that behaves in the same exact way /contractagreement/request does plus adding information about eventual retirement.

This will make the frontend snappier because there won't be the need to do 2 calls anymore.

Attributes added:

  • isRetired: boolean
  • retiredAt: number
  • retirementReason: string

How

It looks a bit hacky, but what I did is:

  • inject contract negotiation store in the retirement store in order to:
    • being able to query agreements and join the retirement table
    • set the same "mapping" needed to query the agreements
  • add the query agreements method on the retirement service
  • create a transformer for the EnhancedAgreement that uses the original ContractAgreement transformer
  • Add a new endpoint controller

Notes

  • The transferCount information has not been added yet, because it would require an additional chunk of work.
    Let's validate this first and do the rest later.
  • "enhanced agreements" is not a really good name, but any advice will be appreciated

@ndr-brt ndr-brt added the enhancement New feature or request label Feb 26, 2026
@ndr-brt ndr-brt force-pushed the agreement-performance-poc branch from ab7a9fd to cc08dca Compare February 26, 2026 15:47
@ndr-brt ndr-brt marked this pull request as draft February 27, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant