@benshi.ai/react-native-bsh-e-com
Version:
benshi.ai SDK for tracking logs for E-Commerce content block
342 lines (316 loc) • 6.5 kB
text/typescript
// ENUMS
export enum ItemAction {
View = "view",
Detail = "detail",
Impression = "impression",
AddToFavorite = "add_favorite",
RemoveFromFavorite = "remove_favorite",
AddToReminder = "add_reminder",
RemoveFromReminder = "remove_reminder",
RemoveFromReminderAuto = "remove_reminder_auto",
}
export enum StockStatus {
InStock = 'in_stock',
LowStock = 'low_stock',
OutOfStock = 'out_of_stock'
}
export enum ItemType {
Blood = "blood",
Oxygen = "oxygen",
Drug = "drug",
MedicalEquipment = "medical_equipment",
Electronics = "electronics",
Clothing = "clothing",
Book = "book",
Misc = "misc"
}
export enum CartAction {
AddItem = "add_item",
RemoveItem = "remove_item"
}
export enum ScheduledDeliveryAction {
Schedule = "schedule",
Update = "update"
}
export enum CancelType {
Cart = "cart",
Order = "order"
}
export enum DeliveryAction {
Delivered = "delivered"
}
// EVENT PROPERTIES
export interface ItemProperties {
action: ItemAction,
item: ItemDetail,
search_id?: string
}
export interface ItemDetail {
id: string,
type: ItemType,
quantity: number,
price: number,
currency: CurrencyCode,
stock_status?: StockStatus,
promo_id?: string,
meta?: BloodMetaModel | OxygenMetaModel
}
export interface BloodMetaModel {
cross_matching: boolean,
temperature_strips: boolean,
extra_tests: boolean,
reason: string
}
export interface OxygenMetaModel {
order_type: string,
reason: string
}
export interface DeliveryProperties {
id: string, // delivery_id
order_id: string,
action: DeliveryAction
}
export interface ScheduledDeliveryProperties {
order_id: string,
is_urgent: boolean,
action: ScheduledDeliveryAction,
delivery_ts: string
}
export interface CancelCheckoutProperties {
id: string,
type: CancelType,
items_list: Array<ItemTypeModel>,
reason: string
}
export interface ItemTypeModel {
id: string,
type: ItemType
}
export interface CartProperties {
id: string;
action: CartAction,
item: ItemDetail,
cart_price: number,
currency: CurrencyCode,
}
export interface CheckoutProperties {
id: string //order_id
cart_id: string,
is_successful: boolean
cart_price: number,
currency: CurrencyCode,
items_list: Array<ItemDetail>,
}
export interface ItemImpressionModel {
item_properties: ItemProperties
catalog_properties?: DrugProperties | BloodProperties | OxygenProperties | MedicalEquipmentProperties
}
// CATALOG OBJECTS
export interface DrugProperties {
market_id: string,
name?: string,
description?: string,
supplier_id: string,
supplier_name: string,
producer?: string,
packaging?: string,
active_ingredients: Array<string>,
drug_form?: string,
drug_strength?: string,
atc_anatomical_group?: string,
otc_or_ethical?: string
}
export interface BloodProperties {
market_id: string,
blood_component: string,
blood_group: string,
packaging?: string,
packaging_size?: number,
packaging_units?: string,
supplier_id?: string,
supplier_name?: string
}
export interface OxygenProperties {
market_id: string,
packaging?: string,
packaging_size?: number,
packaging_units?: string,
supplier_id?: string,
supplier_name?: string
}
export interface MedicalEquipmentProperties {
name: string,
description?: string,
market_id: string,
supplier_id?: string,
supplier_name?: string
producer?: string,
packaging?: string,
packaging_size?: number,
packaging_units?: string,
category?: string,
}
export enum CurrencyCode {
AED = "AED",
AFN = "AFN",
ALL = "ALL",
AMD = "AMD",
ANG = "ANG",
AOA = "AOA",
ARS = "ARS",
AUD = "AUD",
AWG = "AWG",
AZN = "AZN",
BAM = "BAM",
BBD = "BBD",
BDT = "BDT",
BGN = "BGN",
BHD = "BHD",
BIF = "BIF",
BMD = "BMD",
BND = "BND",
BOB = "BOB",
BRL = "BRL",
BSD = "BSD",
BTN = "BTN",
BWP = "BWP",
BYR = "BYR",
BZD = "BZD",
CAD = "CAD",
CDF = "CDF",
CHF = "CHF",
CLP = "CLP",
CNY = "CNY",
COP = "COP",
CRC = "CRC",
CUC = "CUC",
CUP = "CUP",
CVE = "CVE",
CZK = "CZK",
DJF = "DJF",
DKK = "DKK",
DOP = "DOP",
DZD = "DZD",
EGP = "EGP",
ERN = "ERN",
ETB = "ETB",
EUR = "EUR",
FJD = "FJD",
FKP = "FKP",
GBP = "GBP",
GEL = "GEL",
GGP = "GGP",
GHS = "GHS",
GIP = "GIP",
GMD = "GMD",
GNF = "GNF",
GTQ = "GTQ",
GYD = "GYD",
HKD = "HKD",
HNL = "HNL",
HRK = "HRK",
HTG = "HTG",
HUF = "HUF",
IDR = "IDR",
ILS = "ILS",
IMP = "IMP",
INR = "INR",
IQD = "IQD",
IRR = "IRR",
ISK = "ISK",
JEP = "JEP",
JMD = "JMD",
JOD = "JOD",
JPY = "JPY",
KES = "KES",
KGS = "KGS",
KHR = "KHR",
KMF = "KMF",
KPW = "KPW",
KRW = "KRW",
KWD = "KWD",
KYD = "KYD",
KZT = "KZT",
LAK = "LAK",
LBP = "LBP",
LKR = "LKR",
LRD = "LRD",
LSL = "LSL",
LYD = "LYD",
MAD = "MAD",
MDL = "MDL",
MGA = "MGA",
MKD = "MKD",
MMK = "MMK",
MNT = "MNT",
MOP = "MOP",
MRO = "MRO",
MUR = "MUR",
MVR = "MVR",
MWK = "MWK",
MXN = "MXN",
MYR = "MYR",
MZN = "MZN",
NAD = "NAD",
NGN = "NGN",
NIO = "NIO",
NOK = "NOK",
NPR = "NPR",
NZD = "NZD",
OMR = "OMR",
PAB = "PAB",
PEN = "PEN",
PGK = "PGK",
PHP = "PHP",
PKR = "PKR",
PLN = "PLN",
PYG = "PYG",
QAR = "QAR",
RON = "RON",
RSD = "RSD",
RUB = "RUB",
RWF = "RWF",
SAR = "SAR",
SBD = "SBD",
SCR = "SCR",
SDG = "SDG",
SEK = "SEK",
SGD = "SGD",
SHP = "SHP",
SLL = "SLL",
SOS = "SOS",
SPL = "SPL",
SRD = "SRD",
STD = "STD",
SVC = "SVC",
SYP = "SYP",
SZL = "SZL",
THB = "THB",
TJS = "TJS",
TMT = "TMT",
TND = "TND",
TOP = "TOP",
TRY = "TRY",
TTD = "TTD",
TVD = "TVD",
TWD = "TWD",
TZS = "TZS",
UAH = "UAH",
UGX = "UGX",
USD = "USD",
UYU = "UYU",
UZS = "UZS",
VEF = "VEF",
VND = "VND",
VUV = "VUV",
WST = "WST",
XAF = "XAF",
XCD = "XCD",
XDR = "XDR",
XOF = "XOF",
XPF = "XPF",
YER = "YER",
ZAR = "ZAR",
ZMW = "ZMW",
ZWD = "ZWD"
}