UNPKG

@fabrix/spool-cart

Version:

Spool - eCommerce Spool for Fabrix

228 lines (227 loc) 6.23 kB
import { FabrixModel as Model } from '@fabrix/fabrix/dist/common'; import { SequelizeResolver } from '@fabrix/spool-sequelize'; export declare class ProductVariantResolver extends SequelizeResolver { findByIdDefault(id: any, options?: {}): any; findAllDefault(options?: { [key: string]: any; }): any; resolve(variant: any, options?: { [key: string]: any; }): any; } export declare class ProductVariant extends Model { static readonly resolver: typeof ProductVariantResolver; static config(app: any, Sequelize: any): { options: { underscored: boolean; enums: { UNITS: { G: string; KG: string; OZ: string; LB: string; }; INTERVALS: { NONE: any; DAY: string; WEEK: string; BIWEEK: string; MONTH: string; BIMONTH: string; YEAR: string; BIYEAR: string; }; INVENTORY_POLICY: { DENY: string; RESTRICT: string; CONTINUE: string; }; VARIANT_DEFAULTS: { PUBLISHED: boolean; MAX_QUANTITY: number; TAX_CODE: string; WEIGHT_UNIT: string; CURRENCY: string; AVAILABLE: boolean; FULFILLMENT_SERVICE: string; SUBSCRIPTION_INTERVAL: number; SUBSCRIPTION_UNIT: any; REQUIRES_SUBSCRIPTION: boolean; REQUIRES_SHIPPING: boolean; REQUIRES_TAX: boolean; INVENTORY_MANAGEMENT: boolean; INVENTORY_POLICY: string; INVENTORY_QUANTITY: number; INVENTORY_LEAD_TIME: number; }; }; scopes: { live: { where: { live_mode: boolean; }; }; }; hooks: { beforeValidate: ((productVariant: any, options: any) => void)[]; beforeCreate: ((productVariant: any, options: any) => any)[]; beforeUpdate: ((productVariant: any, options: any) => any)[]; }; }; }; static schema(app: any, Sequelize: any): { product_id: { type: any; unique: string; }; sku: { type: any; unique: string; allowNull: boolean; set: (val: any) => void; }; title: { type: any; }; type: { type: any; }; option: { type: any; defaultValue: {}; }; property_pricing: { type: any; defaultValue: {}; }; barcode: { type: any; }; price: { type: any; defaultValue: number; }; calculated_price: { type: any; defaultValue: number; }; compare_at_price: { type: any; defaultValue: number; }; currency: { type: any; defaultValue: string; }; discounted_lines: { type: any; defaultValue: any[]; }; total_discounts: { type: any; defaultValue: number; }; total_orders: { type: any; defaultValue: number; }; fulfillment_service: { type: any; defaultValue: string; }; position: { type: any; defaultValue: number; }; published: { type: any; defaultValue: boolean; }; published_at: { type: any; }; unpublished_at: { type: any; }; available: { type: any; defaultValue: boolean; }; requires_shipping: { type: any; defaultValue: boolean; }; requires_taxes: { type: any; defaultValue: boolean; }; requires_subscription: { type: any; defaultValue: boolean; }; subscription_interval: { type: any; defaultValue: number; }; subscription_unit: { type: any; values: any[]; defaultValue: any; }; inventory_management: { type: any; defaultValue: boolean; }; inventory_policy: { type: any; values: string[]; defaultValue: string; }; inventory_quantity: { type: any; defaultValue: number; }; inventory_lead_time: { type: any; defaultValue: number; }; max_quantity: { type: any; defaultValue: number; }; tax_code: { type: any; defaultValue: string; }; weight: { type: any; defaultValue: number; }; weight_unit: { type: any; values: string[]; defaultValue: string; }; google: { type: any; defaultValue: {}; }; amazon: { type: any; defaultValue: {}; }; live_mode: { type: any; defaultValue: any; }; }; static associate(models: any): void; } export interface ProductVariant { checkRestrictions(customer: any, shippingAddress: any): any; checkAvailability(qty: any, options: any): any; resolveImages(options: any): any; resolveShops(options: any): any; resolveDiscounts(options: any): any; resolveMetadata(options: any): any; }