Skip to content

Instantly share code, notes, and snippets.

@brenogcota
Created January 10, 2022 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenogcota/a947c3e8ca7b60b14d1142b3a72de34b to your computer and use it in GitHub Desktop.
Save brenogcota/a947c3e8ca7b60b14d1142b3a72de34b to your computer and use it in GitHub Desktop.
interfaces
/* Autocomplete */
interface ISearchAutocomplete{
queries: Array<IQueries>
products: Array<IProducts>
}
interface IProducts{
id: string
name: string
price: number
oldPrice: number
url: string
images: IImages
installment: Array<IInstallments>
status: string
clickUrl: string
}
interface IInstallments{
price: number
count: number
}
interface IImages{
default: string
}
interface IQueries{
query: string
link: string
}
/* Product summary */
export interface IProductSummaryVtex {
link: string;
linkText: string;
clickUrl: string;
href: string;
commertialOffer: ICommertialOffer;
sku: ISku;
productId: string;
productName: string;
items: ISku[];
priceRange: IPriceRange;
searchId?: string;
}
export interface ISku{
itemId: string;
seller: ISeller;
sellers: ISeller[];
image: IImage;
images: IImage[];
priceRange: IPriceRange;
}
export interface ISeller{
commertialOffer: ICommertialOffer;
sellerId: string;
}
export interface ICommertialOffer{
Price: number;
ListPrice: number;
Installments: IInstallments[];
discountHighlights: Array<{ name: string }>
teasers: Teaser[]
AvailableQuantity: number;
}
interface Teaser{
name: string;
}
interface IInstallments{
NumberOfInstallments: number;
TotalValuePlusInterestRate: number;
Value: number;
}
interface IImage{
imageUrl: string;
}
interface IListPrice{
highPrice: number;
lowPrice: number;
}
interface IPriceRange{
listPrice: IListPrice;
sellingPrice: IListPrice;
}
/* Products vtex */
export interface IProductVtex {
cacheId: string
productId: string
description: string
productName: string
productReference: string
linkText: string
brand: string
link: string
categories: Array<string>
priceRange: IPriceRange
specificationGroups: Array<IItemSpecificationGroups>
skuSpecifications: string // WIP
productClusters: string // WIP
clusterHighlights: string // WIP
properties: Array<IProperties>
items: Array<IItems>
}
interface IItems{
itemId: string
name: string
nameCompelte: string
complementName: string
ean: string;
variation: string // WIP
referenceId: Array<IReferenceId>
mensurementUnit: string
unitMultiplier: number
images: Array<IImages>
sellers: Array<ISellers>
}
interface ISellers{
sellerId: string
sellerName: string
commertialOffer: ICommertialOffer
}
interface ICommertialOffer {
discountHighlights: string // WIP
teasers: string // WIP
Price: number
ListPrice: number
Tax: number
taxPercentage: number
spotPrice: number
PriceWithoutDiscount: number
RewardValue: number
PriceValidUntil: string
AvailableQuantity: number
Installments: Array<IInstallments>
}
interface IInstallments{
Value: number
InterestRate: number
TotalValuePlusInterestRate: number
NumberOfInstallments: number
Name: string
PaymentSystemName: string
}
interface IImages{
cacheId: string
imageId: string
imageLabel: string
imageTag: string
imageUrl: string
imageText: string
}
interface IReferenceId{
Key: string;
Value: string;
}
interface IProperties {
name: string
values: Array<string>
}
interface IItemSpecificationGroups {
name: string
originalName: string
values: Array<string>
}
interface IPriceRange {
sellingPrice: IItemPriceRange
listPrice: IItemPriceRange
}
interface IItemPriceRange{
highPrice: number
lowPrice: number
}
/* Products Linx */
export interface IFiltersValues {
label?: string,
size: number,
idO?: string,
id?: number,
unityId?: number,
nuN: string,
min?: {
value: number,
unity: string,
minN: number
}
max?: {
value: number,
unity: string,
maxN: number
}
filters?: Array<IFiltersValues>,
applyLink: string,
}
export interface IFilters {
id: number,
attribute: string,
type: string,
fType: number,
values: Array<IFiltersValues>
}
export interface IPagination {
first: string,
last: string,
next: string,
}
export interface ICategory {
parents: Array<string>
id: string,
name: string
}
export interface ISku {
sku: string,
specs: {
sellers: [
{
oldPrice: number,
installment: {
count: number,
price: number
},
sellerDefault: true,
sellerName: string,
sellerId: string,
price: number
}
],
clusterHighlights: Array<Object>,
salesChannel: Array<string>,
measurement: [
{
unit: string,
multiplier: number
}
],
availableQuantity: Array<string>
},
status: string,
price: number,
oldPrice: number,
installment: {
price: number,
count: number
},
images: {
default: string
},
details: {
referenceId: string,
measurement: {
unit: string,
multiplier: number
},
sellers: [
{
oldPrice: number,
installment: {
count: number,
price: number
},
sellerDefault: boolean,
sellerName: string,
sellerId: string,
price: number
}
]
},
url: string
}
export interface IDetails {
Quantidade: Array<string>,
productReference: Array<string>,
"Princípio Ativo": Array<string>,
brand: Array<string>,
Fabricante: Array<string>,
"Registro MS": Array<string>,
"Para que serve": Array<string>,
"Observação": Array<string>,
"Forma Farmacêutica": Array<string>,
Dosagem: Array<string>,
clusterHighlights: Array<Object>,
salesChannel: Array<number>,
"Categoria do Medicamento": Array<string>,
categoryName: Array<string>
availableQuantity: string[];
teasers: Teaser[];
}
interface Teaser{
name: string;
}
export interface IProductsB {
id: string,
collectionInfo: {
skuList: Array<any>,
productId: string
}
name: string,
price: number,
oldPrice: number,
url: string,
images: {
default: string,
"400x400"?: string,
"1000x1000"?: string,
template?: string,
"200x200"?: string
},
installment: {
price: number,
count: number,
},
status: string,
trackingUrl: string,
categories: Array<ICategory>,
tags: Array<ICategory>,
created: string,
selectedSku: string,
cId: string,
iId: number,
skus: Array<ISku>,
details: IDetails,
businessInfo: {
percentage?: number,
age?: number
}
}
export interface ISort {
label: string,
name: string,
type: string,
applyLink: string,
}
export interface IQueries {
original: string,
normalized: string,
processed: string,
queryType: string,
}
export interface IProductLinx {
requestId: string,
searchId: string,
filters: Array<IFilters>,
size: number,
pagination: IPagination,
products: Array<IProductsB>,
sort: Array<ISort>,
queries: IQueries,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment