superfaceai / station

Comlink metadata for self-integrating applications.
https://superface.ai/catalog
MIT License
22 stars 5 forks source link

feat: Crisp integration for `crm/contacts` #170

Closed kysely closed 2 years ago

kysely commented 2 years ago

Description

Adding Crisp chat integration to crm/contacts.

Few concerns

Crisp uses a separate subresource for contact's custom properties (they call it “custom data”). This brings several challenges when mutating the data in a single use case.

Create use case

I chose to fail the whole Create use case when custom data patch fails with a custom error describing the issue. No one will actually read the map and implement the special case, but:

Alternatively, we could simply not support this use case (like Mixpanel integration) and quietly create the non-existent resource in Update.

Update use case

This is much easier since Update is much more idempotent-ish. We simply fail the whole use case call and it can be safely retried, yielding the desired end result.

Motivation and Context

Types of changes

Checklist:

kysely commented 2 years ago

@TheEdward162 Thanks! I worked in all the suggestions :)