Skip to content

Commit

Permalink
Tracker models: add fields to track data processed by Notif workflow (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph authored Dec 13, 2024
1 parent bec1631 commit 0bff6b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions front/lib/models/doc_tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class TrackerConfigurationModel extends SoftDeletableModel<TrackerConfigu
declare prompt: string | null;

declare frequency: string | null;
declare lastNotifiedAt: Date | null;

declare recipients: string[] | null;

Expand Down Expand Up @@ -87,6 +88,10 @@ TrackerConfigurationModel.init(
type: DataTypes.STRING,
allowNull: true,
},
lastNotifiedAt: {
type: DataTypes.DATE,
allowNull: true,
},
recipients: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
Expand Down Expand Up @@ -215,6 +220,8 @@ export class TrackerGenerationModel extends SoftDeletableModel<TrackerGeneration
declare dataSourceId: ForeignKey<DataSourceModel["id"]>;
declare documentId: string;

declare consumedAt: Date | null;

declare trackerConfiguration: NonAttribute<TrackerConfigurationModel>;
}

Expand Down Expand Up @@ -245,6 +252,10 @@ TrackerGenerationModel.init(
type: DataTypes.STRING,
allowNull: false,
},
consumedAt: {
type: DataTypes.DATE,
allowNull: true,
},
},
{
modelName: "tracker_generation",
Expand Down
2 changes: 2 additions & 0 deletions front/migrations/db/migration_130.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "public"."tracker_configurations" ADD COLUMN "lastNotifiedAt" TIMESTAMP WITH TIME ZONE;
ALTER TABLE "public"."tracker_generations" ADD COLUMN "consumedAt" TIMESTAMP WITH TIME ZONE;

0 comments on commit 0bff6b4

Please sign in to comment.