If you are implementing a Family model, make sure you pass familyId to the Product model. This way, you can associate a family with a product.
Properties
idstring
required
Unique identifier of the family
namestring
required
Customer-facing name.
descriptionstring
optional
Customer-facing description.
Code Example
import { Integrator } from '@churnkey/ts-sdk'
export class Family extends Integrator.Family {
constructor(family: YourFamily) {
super(
{
id: family.id,
... // map other properties
}
)
}
}
interface Family {
id: string
name: string
description?: string
}
export function Family(family: YourFamily) {
return {
id: family.id,
... // map other properties
}
}
package models
type Family struct {
ID string `json:"id"`
Name string `json:"name"`
Description *string `json:"description"`
}
func Family(family YourFamily) Family {
return Family{
ID: family.ID,
... // map other properties
}
}