Nzoni docs
  • Getting Started
  • Angular
    • Project Structure
    • Authentication, Magic Link and Google Auth
    • Landing page
    • Payments and Plans
    • Blog and articles
    • User Dashboard
    • Admin Dashboard
    • SEO & SSR
    • Deploy Angular Project
  • Nest.js
    • Project Structure
    • Authentication, Google auth and Magic link
    • Blogposts
    • Plans
    • Stripe Payment
    • Email and Templates
    • Database and Migration
    • Image File upload
    • Users
    • Deploy Nest.js project
  • Node.js/MongoDB
    • Project structure
    • API endpoints
  • Angular / Firebase / Node.js
  • Create first and default plan
  • Create an Admin User
  • Support
  • Licenses
Powered by GitBook
On this page
  • Subscriptions module path
  • Entity
  1. Nest.js

Plans

Subscriptions module path

├── node_modules
├── mail-templates
├── migrations
├── src
│   ├── configs
│   ├── domains
│   │   ├── plans     # Plan module

Entity

  @Entity()
  export class Plan extends BaseEntity {
    @PrimaryGeneratedColumn()
    id: number;

    @Column({ nullable: true })
    label: string;

    @Column({ nullable: true })
    price: number;

    /** @type {SubscriptionType} */
    @Column({ nullable: false })
    type: string;

    @Column({ nullable: true })
    devise: string;

    @Column({ nullable: true, })
    description: string;

    @Column({ nullable: true, type: 'jsonb' })
    features: string[];

    @Column({ nullable: false })
    stripePlanId: string;

    @Column({ default: false })
    popular: boolean;

    @CreateDateColumn()
    createdAt: Date;

    @UpdateDateColumn()
    updatedAt: Date;

    @OneToMany(() => User, user => user.subscription)
    users: User[];
  }
PreviousBlogpostsNext Stripe Payment

Last updated 1 year ago