Skip to content

Commit

Permalink
feat(models): add missing PR fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thatkookooguy committed Apr 29, 2021
1 parent 8ee15be commit eb31d69
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
25 changes: 25 additions & 0 deletions server/src/models/pull-request.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,31 @@ export class PullRequest extends BaseModel {
@PersistInDb()
reviews?: any[];

@Expose()
@IsOptional()
@PersistInDb()
comments?: any[];

@Expose()
@IsOptional()
@PersistInDb()
inlineComments?: any[];

@Expose()
@IsOptional()
@PersistInDb()
commits?: any[];

@Expose()
@IsOptional()
@PersistInDb()
files?: any[];

@Expose()
@IsOptional()
@PersistInDb()
reactions?: any[];

constructor(partial: Partial<PullRequest> = {}) {
super();
Object.assign(this, partial);
Expand Down
65 changes: 65 additions & 0 deletions server/test/__snapshots__/github-events.e2e-spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ Array [
"assignees": Array [
"Thatkookooguy",
],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -95,14 +100,19 @@ exports[`AppController (e2e) pr events / (POST) github pull request assignee rem
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -174,14 +184,19 @@ exports[`AppController (e2e) pr events / (POST) github pull request created even
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -224,9 +239,12 @@ exports[`AppController (e2e) pr events / (POST) github pull request edited 4`] =
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"description": Array [
null,
Expand All @@ -235,10 +253,12 @@ Array [
"Create test-event.ts",
],
},
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -281,19 +301,24 @@ exports[`AppController (e2e) pr events / (POST) github pull request label remove
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"labels": Object {
"added": 1,
"removed": 1,
},
},
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -336,20 +361,25 @@ exports[`AppController (e2e) pr events / (POST) github pull request labeled 4`]
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"labels": Object {
"added": 1,
},
},
"inlineComments": Array [],
"labels": Array [
"pizza",
],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -392,20 +422,25 @@ exports[`AppController (e2e) pr events / (POST) github pull request labeled: ini
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"labels": Object {
"added": 1,
},
},
"inlineComments": Array [],
"labels": Array [
"bug",
],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -448,14 +483,19 @@ exports[`AppController (e2e) pr events / (POST) github pull request review comme
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [
Object {
Expand Down Expand Up @@ -510,20 +550,25 @@ exports[`AppController (e2e) pr events / (POST) github pull request review comme
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"reviewComments": Object {
"deleted": Array [
620286741,
],
},
},
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -566,20 +611,25 @@ exports[`AppController (e2e) pr events / (POST) github pull request review comme
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"reviewComments": Object {
"edited": Array [
620286741,
],
},
},
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [
Object {
Expand Down Expand Up @@ -637,14 +687,19 @@ exports[`AppController (e2e) pr events / (POST) github pull request review reque
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [
Expand Down Expand Up @@ -689,14 +744,19 @@ exports[`AppController (e2e) pr events / (POST) github pull request review submi
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": undefined,
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down Expand Up @@ -749,18 +809,23 @@ exports[`AppController (e2e) pr events / (POST) github pull request reviewer rem
Array [
Object {
"assignees": Array [],
"comments": Array [],
"commits": Array [],
"createdOn": 2019-12-12T13:48:34.000Z,
"creator": "Thatkookooguy",
"description": "",
"files": Array [],
"history": Object {
"deletedReviewers": Array [
"norq87",
],
},
"inlineComments": Array [],
"labels": Array [],
"number": 1,
"organization": undefined,
"prid": "Thatkookooguy/test-new-achievibit-events/pull/1",
"reactions": Array [],
"repository": "Thatkookooguy/test-new-achievibit-events",
"reviewComments": Array [],
"reviewers": Array [],
Expand Down

0 comments on commit eb31d69

Please sign in to comment.