@fabrix/spool-cart
Version:
Spool - eCommerce Spool for Fabrix
314 lines (313 loc) • 8.62 kB
TypeScript
import { FabrixModel as Model } from '@fabrix/fabrix/dist/common';
import { SequelizeResolver } from '@fabrix/spool-sequelize';
export declare class SubscriptionResolver extends SequelizeResolver {
findByIdDefault(criteria: any, options?: {}): any;
findByTokenDefault(token: any, options?: {}): any;
batch(options: any, batch: any): any;
resolveByInstance(subscription: any, options?: {
[key: string]: any;
}): Promise<any>;
resolveById(subscription: any, options?: {
[key: string]: any;
}): any;
resolveByToken(subscription: any, options?: {
[key: string]: any;
}): any;
resolveByNumber(subscription: any, options?: {
[key: string]: any;
}): any;
resolveByString(subscription: any, options?: {
[key: string]: any;
}): any;
resolve(subscription: any, options?: {
[key: string]: any;
}): any;
}
export declare class Subscription extends Model {
static readonly resolver: typeof SubscriptionResolver;
static config(app: any, Sequelize: any): {
options: {
underscored: boolean;
enums: {
INTERVALS: {
NONE: any;
DAY: string;
WEEK: string;
BIWEEK: string;
MONTH: string;
BIMONTH: string;
YEAR: string;
BIYEAR: string;
};
SUBSCRIPTION_CANCEL: {
CUSTOMER: string;
FRAUD: string;
INVENTORY: string;
FUNDING: string;
OTHER: string;
};
};
scopes: {
live: {
where: {
live_mode: boolean;
};
};
active: {
where: {
active: boolean;
};
};
deactivated: {
where: {
active: boolean;
cancelled: boolean;
};
};
cancelled: {
where: {
cancelled: boolean;
};
};
};
indexes: {
fields: string[];
using: string;
operator: string;
}[];
hooks: {
beforeCreate: ((subscription: any, options: any) => any)[];
beforeUpdate: ((subscription: any, options: any) => any)[];
afterCreate: ((subscription: any, options: any) => any)[];
afterUpdate: ((subscription: any, options: any) => any)[];
};
};
};
static schema(app: any, Sequelize: any): {
token: {
type: any;
unique: boolean;
};
shop_id: {
type: any;
};
original_order_id: {
type: any;
};
last_order_id: {
type: any;
};
customer_id: {
type: any;
allowNull: boolean;
};
email: {
type: any;
};
interval: {
type: any;
defaultValue: number;
};
unit: {
type: any;
values: any[];
defaultValue: string;
};
active: {
type: any;
defaultValue: boolean;
};
renewed_at: {
type: any;
defaultValue: any;
};
renews_on: {
type: any;
defaultValue: any;
};
total_renewals: {
type: any;
defaultValue: number;
};
renew_retry_at: {
type: any;
};
total_renewal_attempts: {
type: any;
defaultValue: number;
};
cancelled: {
type: any;
defaultValue: boolean;
};
cancel_reason: {
type: any;
values: string[];
};
cancelled_at: {
type: any;
};
currency: {
type: any;
defaultValue: string;
};
line_items: {
type: any;
defaultValue: any[];
};
subtotal_price: {
type: any;
defaultValue: number;
};
discounted_lines: {
type: any;
defaultValue: any[];
};
coupon_lines: {
type: any;
defaultValue: any[];
};
shipping_lines: {
type: any;
defaultValue: any[];
};
shipping_included: {
type: any;
defaultValue: boolean;
};
shipping_rate: {
type: any;
defaultValue: any[];
};
shipping_rates: {
type: any;
defaultValue: any[];
};
has_shipping: {
type: any;
defaultValue: boolean;
};
has_taxes: {
type: any;
defaultValue: boolean;
};
total_items: {
type: any;
defaultValue: number;
};
tax_shipping: {
type: any;
defaultValue: boolean;
};
tax_lines: {
type: any;
defaultValue: any[];
};
tax_rate: {
type: any;
defaultValue: number;
};
tax_percentage: {
type: any;
defaultValue: number;
};
taxes_included: {
type: any;
defaultValue: boolean;
};
total_discounts: {
type: any;
defaultValue: number;
};
total_coupons: {
type: any;
defaultValue: number;
};
total_line_items_price: {
type: any;
defaultValue: number;
};
pricing_overrides: {
type: any;
defaultValue: any[];
};
pricing_override_id: {
type: any;
};
total_overrides: {
type: any;
defaultValue: number;
};
total_price: {
type: any;
defaultValue: number;
};
total_due: {
type: any;
defaultValue: number;
};
total_shipping: {
type: any;
defaultValue: number;
};
total_tax: {
type: any;
defaultValue: number;
};
total_weight: {
type: any;
defaultValue: number;
};
notice_sent: {
type: any;
defaultValue: boolean;
};
notice_sent_at: {
type: any;
};
live_mode: {
type: any;
defaultValue: any;
};
};
static associate(models: any): void;
}
export interface Subscription {
activate(): any;
resolveCustomer(options: any): any;
resolveDiscounts(options: any): any;
resolveLastOrder(options: any): any;
resolveOriginalOrder(options: any): any;
notifyCustomer(preNotification: any, options: any): any;
resetDefaults(): any;
setLineProperties(line: any): any;
setLineItems(lines: any): any;
setItemDiscountedLines(item: any, discount: any, criteria: any): any;
setItemsDiscountedLines(discounts: any, criteria: any): any;
setDiscountedLines(lines: any): any;
setPricingOverrides(lines: any): any;
setCouponLines(lines: any): any;
setItemsShippingLines(items: any): any;
setShippingLines(lines: any): any;
setItemsTaxLines(items: any): any;
setTaxLines(lines: any): any;
setTotals(): any;
line(data: any): any;
addLine(item: any, qty: any, properties: any, shop: any, options: any): any;
removeLine(item: any, qty: any): any;
renew(): any;
willRenew(): any;
retry(): any;
sendActivateEmail(options: any): any;
sendCancelledEmail(options: any): any;
sendDeactivateEmail(options: any): any;
sendFailedEmail(options: any): any;
sendRenewedEmail(options: any): any;
sendUpdatedEmail(options: any): any;
sendWillRenewEmail(options: any): any;
buildOrder(data: any): any;
calculateDiscounts(options: any): any;
getCollectionPairs(options: any): any;
calculateTaxes(options: any): any;
recalculate(options: any): any;
}