-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added an ability to store prefedined funnels into the database * ADD GET all funnels * added some account validations * added funnel migrations
- Loading branch information
Showing
15 changed files
with
455 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { IsNotEmpty, Length, ArrayMinSize, ArrayMaxSize } from 'class-validator' | ||
import { | ||
MAX_PAGES_IN_FUNNEL, | ||
MIN_PAGES_IN_FUNNEL, | ||
} from '../../common/constants' | ||
|
||
export class FunnelCreateDTO { | ||
@ApiProperty({ | ||
example: 'User sign up funnel', | ||
required: true, | ||
description: 'A display name for your funnel', | ||
}) | ||
@IsNotEmpty() | ||
@Length(1, 50) | ||
name: string | ||
|
||
@ApiProperty({ | ||
example: 'aUn1quEid-3', | ||
required: true, | ||
description: 'Funnel project ID', | ||
}) | ||
@IsNotEmpty() | ||
pid: string | ||
|
||
@ApiProperty({ | ||
example: ['/', '/signup', '/dashboard'], | ||
required: true, | ||
description: 'Steps of the funnel', | ||
}) | ||
@ArrayMinSize(MIN_PAGES_IN_FUNNEL, { | ||
message: `A funnel must have at least ${MIN_PAGES_IN_FUNNEL} steps`, | ||
}) | ||
@ArrayMaxSize(MAX_PAGES_IN_FUNNEL, { | ||
message: `A funnel must have no more than ${MAX_PAGES_IN_FUNNEL} steps`, | ||
}) | ||
steps: string[] | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { | ||
IsNotEmpty, | ||
Length, | ||
ArrayMinSize, | ||
ArrayMaxSize, | ||
IsUUID, | ||
} from 'class-validator' | ||
import { | ||
MAX_PAGES_IN_FUNNEL, | ||
MIN_PAGES_IN_FUNNEL, | ||
} from '../../common/constants' | ||
|
||
export class FunnelUpdateDTO { | ||
@IsUUID('4') | ||
id: string | ||
|
||
@ApiProperty({ | ||
example: 'aUn1quEid-3', | ||
required: true, | ||
description: 'Funnel project ID', | ||
}) | ||
@IsNotEmpty() | ||
pid: string | ||
|
||
@ApiProperty({ | ||
example: 'User sign up funnel', | ||
required: true, | ||
description: 'A display name for your funnel', | ||
}) | ||
@IsNotEmpty() | ||
@Length(1, 50) | ||
name: string | ||
|
||
@ApiProperty({ | ||
example: ['/', '/signup', '/dashboard'], | ||
required: true, | ||
description: 'Steps of the funnel', | ||
}) | ||
@ArrayMinSize(MIN_PAGES_IN_FUNNEL, { | ||
message: `A funnel must have at least ${MIN_PAGES_IN_FUNNEL} steps`, | ||
}) | ||
@ArrayMaxSize(MAX_PAGES_IN_FUNNEL, { | ||
message: `A funnel must have no more than ${MAX_PAGES_IN_FUNNEL} steps`, | ||
}) | ||
steps: string[] | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
JoinColumn, | ||
ManyToOne, | ||
PrimaryGeneratedColumn, | ||
} from 'typeorm' | ||
import { Project } from './project.entity' | ||
|
||
@Entity() | ||
export class Funnel { | ||
@PrimaryGeneratedColumn('uuid') | ||
id: string | ||
|
||
@Column('varchar', { length: 50 }) | ||
name: string | ||
|
||
@Column({ | ||
type: 'simple-array', | ||
}) | ||
steps: string[] | ||
|
||
@CreateDateColumn() | ||
created: Date | ||
|
||
@ManyToOne(() => Project, project => project.funnels) | ||
@JoinColumn() | ||
project: Project | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export * from './project-subscriber.entity' | ||
export * from './funnel.entity' | ||
export * from './project.entity' | ||
export * from './project-share.entity' |
Oops, something went wrong.