Skip to content

Conversation

@albertsola
Copy link
Contributor

@albertsola albertsola commented Sep 4, 2025

  • Moved resource service update to a mixin
  • Added model for Downloaded files
  • Added Agreement attachments service into Agreements service
  • Added default Accept header as application/json
  • Added headers arguments in service requests

@albertsola albertsola self-assigned this Sep 4, 2025
@albertsola albertsola changed the title MPT-12840 Update service for agreements asset MPT-12840 Endpoint commerce agreements assets Sep 4, 2025
@albertsola albertsola force-pushed the MPT-12840/agreements-assets branch 3 times, most recently from 0c44c49 to 51555c1 Compare September 5, 2025 09:59
@albertsola albertsola changed the title MPT-12840 Endpoint commerce agreements assets MPT-12840 Endpoint commerce agreements attachments Sep 5, 2025
@albertsola albertsola force-pushed the MPT-12840/agreements-assets branch 3 times, most recently from 3483671 to d86f918 Compare September 5, 2025 10:10
@albertsola albertsola marked this pull request as ready for review September 5, 2025 10:12
@albertsola albertsola force-pushed the MPT-12840/agreements-assets branch from d86f918 to 2c3600c Compare September 5, 2025 12:56
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 5, 2025


def build_url(
self,
query_params: dict[str, Any] | None = None,
Copy link
Contributor

@svazquezco svazquezco Sep 5, 2025

Choose a reason for hiding this comment

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

You can remove the comma to avoid splitting the code

Comment on lines +10 to +13
def _json_to_file_payload(resource_data: ResourceData) -> bytes:
return json.dumps(
resource_data, ensure_ascii=False, separators=(",", ":"), allow_nan=False
).encode("utf-8")
Copy link
Contributor

@svazquezco svazquezco Sep 5, 2025

Choose a reason for hiding this comment

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

As we've already discussed, at some point it would be good to move this

Comment on lines +65 to +69
files["_attachment_data"] = (
None,
_json_to_file_payload(resource_data),
"application/json",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Umm… I believe we can also remove the comma to avoid splitting the code unnecessarily

files["_attachment_data"] = (
None,
_json_to_file_payload(resource_data),
"application/json",
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Comment on lines +69 to +70
service = AgreementsService(http_client=http_client)
assert hasattr(service, method)
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
service = AgreementsService(http_client=http_client)
assert hasattr(service, method)
service = AgreementsService(http_client=http_client)
assert hasattr(service, method)

Comment on lines +75 to +76
service = AgreementsService(http_client=async_http_client)
assert hasattr(service, method)
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
service = AgreementsService(http_client=async_http_client)
assert hasattr(service, method)
service = AgreementsService(http_client=async_http_client)
assert hasattr(service, method)

Copy link
Contributor

@svazquezco svazquezco left a comment

Choose a reason for hiding this comment

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

Apologies, I didn't do a deep review (holidays are coming 🌴 ) but it looks really good. Just a few boring comments....

@d3rky d3rky merged commit 52207f4 into main Sep 8, 2025
3 checks passed
@d3rky d3rky deleted the MPT-12840/agreements-assets branch September 8, 2025 08:45
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.

4 participants