-
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.
Merge pull request #52 from pcode-at/feature/create-project
Feature/create project
- Loading branch information
Showing
15 changed files
with
285 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,40 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { HttpResponse } from "src/entities/http-response.entity"; | ||
|
||
export class AuthorizationResponse implements HttpResponse, Authorization { | ||
statusCode: number; | ||
error?: string; | ||
message: string; | ||
data?: any; | ||
export class AuthorizationEntity { | ||
accessToken: string; | ||
refreshToken: string; | ||
|
||
constructor(partial: Partial<AuthorizationResponse>) { | ||
constructor(partial: Partial<AuthorizationEntity>) { | ||
Object.assign(this, partial); | ||
} | ||
accessToken: string; | ||
refreshToken: string; | ||
} | ||
|
||
export class Authorization { | ||
accessToken: string; | ||
refreshToken: string; | ||
export class AuthorizationResponse implements HttpResponse { | ||
@ApiProperty({ example: "200", description: "HTTP status code" }) | ||
statusCode: number; | ||
|
||
@ApiProperty({ example: "Locations found", description: "Message" }) | ||
message: string; | ||
|
||
error?: string; | ||
|
||
constructor(partial: Partial<Authorization>) { | ||
@ApiProperty({ | ||
example: [ | ||
{ | ||
refreshToken: | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjp7InVzZXJJZGVudGlmaWVyIjp7ImlkZW50aWZpZXIiOiJhYmMifX0sImlhdCI6MTY1NzExMDE0OSwiZXhwIjoxNjU3NzE0OTQ5fQ.2ElXSU7zacLs2GScN4GJG56bNMnQmRMXwFPihFfq1EY", | ||
accessToken: | ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjp7InVzZXJJZGVudGlmaWVyIjp7ImlkZW50aWZpZXIiOiJhYmMifX0sImlhdCI6MTY1NzExMDE0OSwiZXhwIjoxNjU3NzE0OTQ5fQ.2ElXSU7zacLs2GScN4GJG56bNMnQmRMXwFPihFfq1EY", | ||
}, | ||
], | ||
description: "Authorization", | ||
}) | ||
data?: AuthorizationEntity; | ||
|
||
constructor(partial: Partial<AuthorizationResponse>) { | ||
Object.assign(this, partial); | ||
} | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,20 +1,27 @@ | ||
import { ApiProperty, ApiResponseProperty } from "@nestjs/swagger"; | ||
import { HttpResponse } from "./http-response.entity"; | ||
|
||
export class LocationResponse implements HttpResponse { | ||
statusCode: number; | ||
message: string; | ||
error?: string; | ||
data?: LocationEntity | LocationEntity[]; | ||
@ApiProperty({ example: "200", description: "HTTP status code" }) | ||
statusCode: number; | ||
|
||
constructor(partial: Partial<LocationResponse>) { | ||
Object.assign(this, partial); | ||
} | ||
@ApiProperty({ example: "Locations found", description: "Message" }) | ||
message: string; | ||
|
||
error?: string; | ||
|
||
@ApiProperty({ example: [{ location: "USA" }], description: "Locations" }) | ||
data?: LocationEntity | LocationEntity[]; | ||
|
||
constructor(partial: Partial<LocationResponse>) { | ||
Object.assign(this, partial); | ||
} | ||
} | ||
|
||
export class LocationEntity { | ||
location: String; | ||
location: String; | ||
|
||
constructor(partial: Partial<LocationEntity>) { | ||
Object.assign(this, partial); | ||
} | ||
} | ||
constructor(partial: Partial<LocationEntity>) { | ||
Object.assign(this, partial); | ||
} | ||
} |
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,36 +1,52 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { Exclude } from "class-transformer"; | ||
import { HttpResponse } from "./http-response.entity"; | ||
|
||
export class ProjectResponse implements HttpResponse { | ||
statusCode: number; | ||
message: string; | ||
error?: string; | ||
data?: ProjectEntity | ProjectEntity[]; | ||
|
||
@ApiProperty({ example: "200", description: "HTTP status code" }) | ||
statusCode: number; | ||
|
||
@ApiProperty({ example: "Locations found", description: "Message" }) | ||
message: string; | ||
|
||
error?: string; | ||
|
||
@ApiProperty({ | ||
example: [ | ||
{ | ||
name: "Project Bluebird", | ||
description: "Project Bluebird is a CIA project that researched interragtion methods.", | ||
creationDate: "1951-05-12", | ||
lastEdited: "1981-02-04", | ||
status: "Discontinued", | ||
}, | ||
], | ||
description: "Projects", | ||
}) | ||
data?: ProjectEntity | ProjectEntity[]; | ||
} | ||
|
||
export class ProjectEntity { | ||
id: string; | ||
name: string; | ||
description: string; | ||
creationDate: Date; | ||
lastEdited: Date; | ||
status: string; | ||
|
||
id: string; | ||
name: string; | ||
description: string; | ||
creationDate: Date; | ||
lastEdited: Date; | ||
status: string; | ||
|
||
@Exclude() | ||
creatorId: string; | ||
@Exclude() | ||
creatorId: string; | ||
|
||
@Exclude() | ||
memberIds: string[]; | ||
@Exclude() | ||
memberIds: string[]; | ||
|
||
@Exclude() | ||
skillIds: string[]; | ||
@Exclude() | ||
skillIds: string[]; | ||
|
||
@Exclude() | ||
bookmarkIds: string[] | ||
@Exclude() | ||
bookmarkIds: string[]; | ||
|
||
constructor(partial: Partial<ProjectEntity>) { | ||
Object.assign(this, partial); | ||
} | ||
} | ||
constructor(partial: Partial<ProjectEntity>) { | ||
Object.assign(this, partial); | ||
} | ||
} |
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
Oops, something went wrong.