Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/billing/store.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { List, Map, Set } from "immutable";67import { redux, Store, TypedMap } from "@cocalc/frontend/app-framework";8import { SiteLicense } from "@cocalc/util/types/site-licenses";9import { AppliedCoupons, CoursePay, CustomerMap, InvoicesMap } from "./types";1011export interface BillingStoreState {12stripe_publishable_key?: string;13applied_coupons: AppliedCoupons;14coupon_error?: string;15error?: string;16action?: string;17no_stripe?: boolean;18customer?: CustomerMap;19invoices?: InvoicesMap;20loaded?: boolean;21continue_first_purchase?: boolean;22selected_plan?: string;23course_pay: CoursePay;24managed_license_ids?: List<string>; // array of active (or recently expired) id's of license you manage. Not a changefeed -- you must explicitly call update_managed_licenses action.25all_managed_license_ids?: List<string>; // same as managed_license_ids, but also includes all expired licenses.26managed_licenses?: TypedMap<{ [id: string]: SiteLicense }>; // actual data of the licenses.27subscription_list_state?: "view" | "buy_upgrades" | "buy_license";28pay_as_you_go?: TypedMap<{29showModal?: boolean;30service?: string;31cost?: number;32reason?: string;33allowed?: boolean;34}>;35}3637export class BillingStore extends Store<BillingStoreState> {}3839export const store = redux.createStore("billing", BillingStore, {40applied_coupons: Map<string, any>(),41course_pay: Set<string>(),42});434445