-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user model scaffold, sharing dependencies
- Loading branch information
Showing
11 changed files
with
98 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
"collection": "@nestjs/schematics", | ||
"compilerOptions": { | ||
"deleteOutDir": true | ||
} | ||
}, | ||
"entryFile": "api/src/main" | ||
} |
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,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { UsersService } from './users.service'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { User } from '@shared/entities/users/user.entity'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([User])], | ||
providers: [UsersService], | ||
}) | ||
export class UsersModule {} |
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,4 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class UsersService {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,4 +7,5 @@ packages: | |
catalog: | ||
pg: "^8.12.0" | ||
typeorm: "^0.3.20" | ||
zod: "^3.23.8" | ||
zod: "^3.23.8" | ||
class-transformer: "^0.5.1" |
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,3 @@ | ||
import { User } from "@shared/entities/users/user.entity"; | ||
|
||
export const DATABASE_ENTITIES = [User]; |
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,24 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
OneToMany, | ||
PrimaryGeneratedColumn, | ||
} from "typeorm"; | ||
import { Exclude } from "class-transformer"; | ||
|
||
@Entity({ name: "users" }) | ||
export class User { | ||
@PrimaryGeneratedColumn("uuid") | ||
id: string; | ||
|
||
@Column({ unique: true }) | ||
email: string; | ||
|
||
@Column() | ||
@Exclude() | ||
password: string; | ||
|
||
@CreateDateColumn({ name: "created_at" }) | ||
createdAt: Date; | ||
} |
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