Skip to content

Commit

Permalink
style: style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aguzmant103 committed Oct 16, 2023
1 parent 0762955 commit f32f25c
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/api/src/app/credentials/credentials.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe("CredentialsService", () => {
name: "Group1",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600,
credentials: JSON.stringify({
id: "GITHUB_FOLLOWERS",
Expand All @@ -85,6 +86,7 @@ describe("CredentialsService", () => {
name: "Group2",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/app/groups/docSchemas/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class Group {
@ApiProperty()
treeDepth: number
@ApiProperty()
treeRoot: number
@ApiProperty()
fingerprintDuration: number
@ApiProperty()
createdAt: Date
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/app/groups/docSchemas/groupResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class GroupResponse {
@ApiProperty()
treeDepth: number
@ApiProperty()
treeRoot: number
@ApiProperty()
fingerprintDuration: number
@ApiProperty()
credentials: object
Expand Down
5 changes: 5 additions & 0 deletions apps/api/src/app/groups/dto/create-group.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export class CreateGroupDto {
@Max(32)
readonly treeDepth: number

@IsNumber()
@Min(16)
@Max(32)
readonly treeRoot: number

@IsNumber()
@Min(0)
readonly fingerprintDuration: number
Expand Down
6 changes: 6 additions & 0 deletions apps/api/src/app/groups/entities/group.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export class Group {
@Column({ name: "tree_depth" })
treeDepth: number

@Column({
name: "tree_root",
nullable: true /* TODO: remove this as this is always needed */
})
treeRoot: number

@Column({ name: "fingerprint_duration" })
fingerprintDuration: number

Expand Down
13 changes: 13 additions & 0 deletions apps/api/src/app/groups/groups.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe("GroupsService", () => {
name: "Group1",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand All @@ -66,6 +67,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand All @@ -83,6 +85,7 @@ describe("GroupsService", () => {
name: "Group3",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -111,6 +114,7 @@ describe("GroupsService", () => {
name: "Group4",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600,
credentials: {
id: "GITHUB_FOLLOWERS",
Expand Down Expand Up @@ -184,6 +188,7 @@ describe("GroupsService", () => {
name: "Group01",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin01"
Expand All @@ -195,6 +200,7 @@ describe("GroupsService", () => {
name: "Group02",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin02"
Expand Down Expand Up @@ -232,6 +238,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -352,6 +359,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 21,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -396,6 +404,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 21,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -430,6 +439,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -531,6 +541,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -637,6 +648,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -685,6 +697,7 @@ describe("GroupsService", () => {
name: "Group2",
description: "This is a new group",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/app/groups/groups.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function mapGroupToResponseDTO(
description: group.description,
admin: group.adminId,
treeDepth: group.treeDepth,
treeRoot: group.treeRoot,
fingerprintDuration: group.fingerprintDuration,
createdAt: group.createdAt,
members: (group.members || []).map((m) => m.id),
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/app/invites/invites.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe("InvitesService", () => {
name: "Group1",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600
},
"admin"
Expand Down Expand Up @@ -83,6 +84,7 @@ describe("InvitesService", () => {
name: "Group2",
description: "This is a description",
treeDepth: 16,
treeRoot: 1,
fingerprintDuration: 3600,
credentials: {
id: "GITHUB_FOLLOWERS",
Expand Down
1 change: 1 addition & 0 deletions database/seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CREATE TABLE groups (
description character varying NOT NULL,
admin_id character varying NOT NULL,
tree_depth integer NOT NULL,
tree_root integer, /* TODO: make it NOT NULL */
fingerprint_duration integer NOT NULL,
credentials text,
api_enabled boolean NOT NULL DEFAULT false,
Expand Down

0 comments on commit f32f25c

Please sign in to comment.