Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Update timestamps to reflect dev status changes #203

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "jira_associated_figma_design" ADD COLUMN "dev_status" TEXT NOT NULL DEFAULT 'UNKNOWN',
ADD COLUMN "last_updated" TEXT NOT NULL DEFAULT '1970-01-01T00:00:00.000Z';
2 changes: 2 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ model AssociatedFigmaDesign {
nodeId String @map("node_id") // Prisma does not support nullable columns with the composite indexes: https://github.com/prisma/prisma/issues/3197
associatedWithAri String @map("associated-with-ari")
inputUrl String? @map("input_url")
devStatus String @default("UNKNOWN") @map("dev_status")
lastUpdated String @default("1970-01-01T00:00:00.000Z") @map("last_updated")

connectInstallation ConnectInstallation @relation(fields: [connectInstallationId], references: [id], onDelete: Cascade, onUpdate: NoAction)
connectInstallationId BigInt @map("connect_installation_id")
Expand Down
4 changes: 4 additions & 0 deletions src/domain/entities/associated-figma-design.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AtlassianDesignStatus } from './atlassian-design';
import type { FigmaDesignIdentifier } from './figma-design-identifier';

/**
Expand All @@ -21,6 +22,9 @@ export type AssociatedFigmaDesign = {
* to adjust the way how designs are constructed and re-submit these designs to Jira.
*/
readonly inputUrl?: string;

readonly devStatus: AtlassianDesignStatus;
readonly lastUpdated: string;
};

export type AssociatedFigmaDesignCreateParams = Omit<
Expand Down
8 changes: 8 additions & 0 deletions src/domain/entities/testing/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,14 @@ export const generateAssociatedFigmaDesignCreateParams = ({
designId = generateFigmaDesignIdentifier(),
associatedWithAri = generateJiraIssueAri(),
connectInstallationId = generateNumericStringId(),
devStatus = AtlassianDesignStatus.NONE,
lastUpdated = new Date().toISOString(),
}: Partial<AssociatedFigmaDesignCreateParams> = {}): AssociatedFigmaDesignCreateParams => ({
designId,
associatedWithAri,
connectInstallationId,
devStatus,
lastUpdated,
});

export const generateAssociatedFigmaDesign = ({
Expand All @@ -215,12 +219,16 @@ export const generateAssociatedFigmaDesign = ({
associatedWithAri = generateJiraIssueAri(),
inputUrl = generateFigmaDesignUrl(designId).toString(),
connectInstallationId = generateNumericStringId(),
devStatus = AtlassianDesignStatus.NONE,
lastUpdated = new Date().toISOString(),
}: Partial<AssociatedFigmaDesign> = {}): AssociatedFigmaDesign => ({
id,
designId,
associatedWithAri,
connectInstallationId,
inputUrl,
devStatus,
lastUpdated,
});

export const generateFigmaTeamCreateParams = ({
Expand Down
Loading
Loading