amocrm-client
Version:
JS Library for AmoCRM
46 lines (41 loc) • 1.69 kB
text/typescript
import { ICriteria, IEntityAttributes } from "./api";
import { Moment, PartialWithRequired } from "./common";
import { ICustomFieldValue } from "./custom_field";
type CatalogElementWithString = "invoice_link";
export type CatalogElementWith = Array<CatalogElementWithString> | CatalogElementWithString;
export type CatalogCriteria = Partial<Pick<ICriteria<never, never>, "page" | "limit">>
export type CatalogElementCriteria = Partial<ICriteria<ICatalogElementFilter, CatalogElementWith>>;
export type CatalogCreateCriteria = PartialWithRequired<Pick<ICatalogAttributes, "name" | "type" | "sort" | "can_add_elements" | "can_link_multiple">, "name">
export type CatalogUpdateCriteria = PartialWithRequired<Pick<ICatalogAttributes, "id" | "name" | "type" | "sort" | "can_add_elements" | "can_link_multiple">, "name" | "id">
export interface ICatalogAttributes extends IEntityAttributes {
name: string;
created_by: number;
updated_by: number;
created_at: Date;
updated_at: Date;
sort: number;
type: string;
can_add_elements: boolean;
can_show_in_cards: boolean;
can_link_multiple: boolean;
can_be_deleted: boolean;
sdk_widget_code: string;
}
export interface ICatalogElementAttributes extends IEntityAttributes {
catalog_id: number;
name: string;
created_by: number;
updated_by: number;
created_at: Date;
updated_at: Date;
is_deleted: boolean;
custom_fields_value: ICustomFieldValue[] | null;
metadata?: {
quantity: number;
catalog_id: number;
price_id: number;
}
}
export interface ICatalogElementFilter {
id: number | number[];
}