Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
IMAGE_NAME: us-east4-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/api-v3/${{ secrets.GCP_PRODUCTION_SERVICE_NAME }}:${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0

- id: 'auth'
name: Authenticate to Google Cloud
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
IMAGE_NAME: us-east4-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/api-v3/${{ secrets.GCP_STAGING_SERVICE_NAME }}:${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0

- id: 'auth'
name: Authenticate to Google Cloud
Expand Down
13 changes: 13 additions & 0 deletions db/migrations/20250813000000_add_scans_timestamp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Knex } from "knex";

export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable("scans", (table) => {
table.bigInteger("timestamp").unsigned().nullable();
});
}

export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable("scans", (table) => {
table.dropColumn("timestamp");
});
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"fast-xml-parser": "^5.2.3",
"firebase": "^12.0.0",
"firebase-admin": "^13.0.2",
"googleapis": "^155.0.0",
"googleapis": "^156.0.0",
"handlebars": "^4.7.8",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
Expand Down
11 changes: 10 additions & 1 deletion src/entities/scan.entity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Column, ID, Table } from "common/objection";
import { Entity } from "entities/base.entity";
import { ApiProperty, PickType } from "@nestjs/swagger";
import { IsOptional, IsString } from "class-validator";
import { IsNumber, IsOptional, IsString } from "class-validator";
import { Type } from "class-transformer";

@Table({
name: "scans",
Expand Down Expand Up @@ -53,11 +54,19 @@ export class Scan extends Entity {
@IsString()
@Column({ type: "string", required: false })
hackathonId: string;

@ApiProperty({ required: false })
@IsOptional()
@IsNumber()
@Type(() => Number)
@Column({ type: "integer", required: false })
timestamp?: number;
}

export class ScanEntity extends PickType(Scan, [
"eventId",
"userId",
"organizerId",
"hackathonId",
"timestamp",
] as const) {}
1 change: 1 addition & 0 deletions src/modules/event/event.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ export class EventController {
...data,
userId,
eventId: id,
timestamp: Date.now(),
})
.byHackathon(data.hackathonId);

Expand Down
216 changes: 126 additions & 90 deletions yarn.lock

Large diffs are not rendered by default.