Skip to content

DoCurious API Reference / adapters / adaptVendor

Function: adaptVendor()

adaptVendor(sql, addresses?): Partial<Vendor>

Defined in: adapters/vendorAdapter.ts:102

Adapt a SQL vendor row to a partial FE Vendor type.

Builds the nested profile, contact, affiliateInfo, and billingAddress objects from flat SQL columns. Venue arrays are left empty since they require separate SQL queries.

Parameters

sql

SqlVendor

Raw SQL vendor row

addresses?

SqlAddress[]

Optional polymorphic address rows (BILLING/SHIPPING)

Returns

Partial<Vendor>

Partial FE Vendor with mapped fields

DoCurious Platform Documentation