/** * Copyright (c) 2020 The Nuinalp Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ import { Model } from '@nuinalp/api-core/browser'; import Plan from './plans'; import Product from './products'; export default class Subscriptions extends Model { protected static adapter: any; id: string; code: string; date_start?: Date; billing_cycles?: number | null; status: 'active' | 'canceled' | 'paused' | 'trial'; quantity_plan: number; plan: Plan; product: Product; cancel_at: string; payment_method: 'boleto' | 'credit_card' | 'pix'; date_last_event: string; postback_url?: string; date_next_event: string; date_expire: string; date_expire_trial: string; total_amount: number; custom_fields?: Record; customer: { id: string; name: string; email: string; }; created_at: Date; updated_at: Date; deleted_at: Date; /** * Cancel a subscription * @param id - Subscription ID */ static cancel(id: string): Promise; /** * Pause a subscription * @param id - Subscription ID */ static pause(id: string): Promise; }