import { Subscription } from '../../../../../types/subscription/dashboard/subscription'
const dateformat = require('dateformat')
const today = new Date()
const oneYearFromToday = new Date().setFullYear(today.getFullYear() + 1)
const nextPaymentDueAt = dateformat(oneYearFromToday, 'dS mmmm yyyy')

export const annualActiveSubscription: Subscription = {
  manager_ids: ['abc123'],
  member_ids: [],
  invited_emails: [],
  groupPlan: false,
  membersLimit: 0,
  _id: 'def456',
  admin_id: 'abc123',
  teamInvites: [],
  planCode: 'collaborator-annual',
  recurlySubscription_id: 'ghi789',
  plan: {
    planCode: 'collaborator-annual',
    name: 'Standard (Collaborator) Annual',
    price_in_cents: 21900,
    annual: true,
    features: {},
    featureDescription: [],
  },
  recurly: {
    tax: 0,
    taxRate: 0,
    billingDetailsLink: '/user/subscription/recurly/billing-details',
    accountManagementLink: '/user/subscription/recurly/account-management',
    additionalLicenses: 0,
    totalLicenses: 0,
    nextPaymentDueAt,
    currency: 'USD',
    state: 'active',
    trialEndsAtFormatted: null,
    trial_ends_at: null,
    activeCoupons: [],
    account: {
      has_canceled_subscription: { _: 'false', $: { type: 'boolean' } },
      has_past_due_invoice: { _: 'false', $: { type: 'boolean' } },
    },
    displayPrice: '$199.00',
  },
}

export const pastDueExpiredSubscription: Subscription = {
  manager_ids: ['abc123'],
  member_ids: [],
  invited_emails: [],
  groupPlan: false,
  membersLimit: 0,
  _id: 'def456',
  admin_id: 'abc123',
  teamInvites: [],
  planCode: 'collaborator-annual',
  recurlySubscription_id: 'ghi789',
  plan: {
    planCode: 'collaborator-annual',
    name: 'Standard (Collaborator) Annual',
    price_in_cents: 21900,
    annual: true,
    features: {},
    featureDescription: [],
  },
  recurly: {
    tax: 0,
    taxRate: 0,
    billingDetailsLink: '/user/subscription/recurly/billing-details',
    accountManagementLink: '/user/subscription/recurly/account-management',
    additionalLicenses: 0,
    totalLicenses: 0,
    nextPaymentDueAt,
    currency: 'USD',
    state: 'expired',
    trialEndsAtFormatted: null,
    trial_ends_at: null,
    activeCoupons: [],
    account: {
      has_canceled_subscription: { _: 'false', $: { type: 'boolean' } },
      has_past_due_invoice: { _: 'true', $: { type: 'boolean' } },
    },
    displayPrice: '$199.00',
  },
}

export const canceledSubscription: Subscription = {
  manager_ids: ['abc123'],
  member_ids: [],
  invited_emails: [],
  groupPlan: false,
  membersLimit: 0,
  _id: 'def456',
  admin_id: 'abc123',
  teamInvites: [],
  planCode: 'collaborator-annual',
  recurlySubscription_id: 'ghi789',
  plan: {
    planCode: 'collaborator-annual',
    name: 'Standard (Collaborator) Annual',
    price_in_cents: 21900,
    annual: true,
    features: {},
    featureDescription: [],
  },
  recurly: {
    tax: 0,
    taxRate: 0,
    billingDetailsLink: '/user/subscription/recurly/billing-details',
    accountManagementLink: '/user/subscription/recurly/account-management',
    additionalLicenses: 0,
    totalLicenses: 0,
    nextPaymentDueAt,
    currency: 'USD',
    state: 'canceled',
    trialEndsAtFormatted: null,
    trial_ends_at: null,
    activeCoupons: [],
    account: {
      has_canceled_subscription: { _: 'true', $: { type: 'boolean' } },
      has_past_due_invoice: { _: 'false', $: { type: 'boolean' } },
    },
    displayPrice: '$199.00',
  },
}

export const pendingSubscriptionChange: Subscription = {
  manager_ids: ['abc123'],
  member_ids: [],
  invited_emails: [],
  groupPlan: false,
  membersLimit: 0,
  _id: 'def456',
  admin_id: 'abc123',
  teamInvites: [],
  planCode: 'collaborator-annual',
  recurlySubscription_id: 'ghi789',
  plan: {
    planCode: 'collaborator-annual',
    name: 'Standard (Collaborator) Annual',
    price_in_cents: 21900,
    annual: true,
    features: {},
    featureDescription: [],
  },
  recurly: {
    tax: 0,
    taxRate: 0,
    billingDetailsLink: '/user/subscription/recurly/billing-details',
    accountManagementLink: '/user/subscription/recurly/account-management',
    additionalLicenses: 0,
    totalLicenses: 0,
    nextPaymentDueAt,
    currency: 'USD',
    state: 'active',
    trialEndsAtFormatted: null,
    trial_ends_at: null,
    activeCoupons: [],
    account: {
      has_canceled_subscription: { _: 'false', $: { type: 'boolean' } },
      has_past_due_invoice: { _: 'false', $: { type: 'boolean' } },
    },
    displayPrice: '$199.00',
  },
  pendingPlan: {
    planCode: 'professional-annual',
    name: 'Professional Annual',
    price_in_cents: 42900,
    annual: true,
    features: {},
    featureDescription: [],
  },
}
