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[];
  }

Last updated