Closed
Conversation
Co-authored-by: Chris Okuda <chris-okuda@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
chris-okuda
commented
Feb 25, 2026
794138f to
00e9356
Compare
- Added validation to ensure only Sunrise counterparties can be created and updated. - Introduced required fields for contact email and name during creation. - Updated the UI to reflect that counterparties created use the Sunrise protocol. - Implemented logic to derive common names from website or email for Sunrise counterparties. - Adjusted validation rules to exclude endpoint and common name requirements for Sunrise counterparties. - Improved error handling and user feedback for invalid operations.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Author
Applied via @cursor push command
Collaborator
Author
|
Cursor bot keeps closing this for some reason, I just wanted to note that's why it was closed/opened a bunch |
Collaborator
Author
|
A valuable exercise to see how agentic coding worked. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope of changes
This PR introduces the complete UI pages, Gin handlers, and routes for Counterparty management, mirroring the existing Account UI flow. Previously, the Counterparty UI lacked detail and edit pages, as well as interactive create and delete functionalities.
The solution implements:
LegalPersonIVMS data (legal name, country of registration, internal customer identifier, national identification, geographic address).pkg/web/scene/counterparty.goadapter to flattenLegalPersonIVMS fields for template rendering.Type of change
Acceptance criteria
NOTE: this is in draft right now because it needs a good review and probably more work put into it; Cursor is pretty good overall but it kinda made a mess in here...
Create — modal (Add Counterparty)
endpoint=mailto:{contact_email}andcommon_namefrom website host or contact email domainCreate — API (POST /v1/counterparties)
protocol: "trisa"or"trp"returns 400 (only Sunrise can be created)protocol: "sunrise"and nocontact_emailreturns 422protocol: "sunrise", validcontact_email, and optionalcontact_name/websitereturns 201;endpointandcommon_nameare derived by the serverDetail page
Edit page — access
/counterparties/{id}/editfor a user-created Sunrise counterparty loads the edit page with the form/counterparties/{id}/editfor a TRISA/TRP or non–user-created counterparty redirects to the detail page (/counterparties/{id})Edit page — save
/v1/counterparties/{id}for a non–user-created or non-Sunrise counterparty returns 403 ForbiddenList page
Author checklist
Reviewer(s) checklist
Note
Medium Risk
Adds and changes counterparty create/update/delete behavior (including derived
endpoint/common_nameand new edit restrictions), which can impact data integrity and user workflows, but is scoped to Counterparties and gated by protocol/source checks and permissions.Overview
Adds full Counterparty management UI, including new detail and edit pages, plus create/delete modals and HTMX-driven interactions (list refresh, redirects, alerts).
Updates the Counterparty API/handlers to support a Sunrise-only create flow using
contact_email/contact_name, derivingendpoint(mailto:) andcommon_name(from website host or email domain), and restricting updates to user-created Sunrise records; create/update/delete now return HTMX-friendly redirects/triggers and JSON responses.Introduces a new
scene.Counterpartyadapter to flatten IVMS101 legal person data for templates, adds route-level permissions for counterparty pages, and expands tests around Sunrise validation andCommonNameFromWebsiteOrEmail.Written by Cursor Bugbot for commit fa2569d. This will update automatically on new commits. Configure here.