feat(FN-192): DB schema + Migration (+7 more)
Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
Commits merged: - feat(FN-192): complete Step 8 — Documentation & Delivery - feat(FN-192): complete Step 7 — Testing & Verification - feat(FN-192): complete Step 6 — i18n keys replace stage with changeType - feat(FN-192): complete Step 5 — ChangelogTab rename stage to changeType - feat(FN-192): complete Step 4 — Badge component rename stage to changeType - feat(FN-192): complete Step 3 — API Service + Controller Spec - feat(FN-192): complete Step 2 — Shared Zod schemas + type exports + DTO - feat(FN-192): complete Step 1 — DB schema + Migration Files changed: apps/api/drizzle/0001_charming_quicksand.sql | 2 + apps/api/drizzle/meta/0001_snapshot.json | 5167 ++++++++++++++++++++ apps/api/drizzle/meta/_journal.json | 9 +- .../api/src/changelog/changelog.controller.spec.ts | 2 +- apps/api/src/changelog/changelog.dto.ts | 2 +- apps/api/src/changelog/changelog.service.spec.ts | 4 +- apps/api/src/changelog/changelog.service.ts | 4 +- apps/api/src/database/schema/core.ts | 2 +- apps/web/src/components/settings/changelog-tab.tsx | 11 +- apps/web/src/messages/en.json | 8 +- apps/web/src/messages/tr.json | 8 +- docs/INDEX.md | 4 +- packages/shared/src/index.ts | 4 +- packages/shared/src/schemas/changelog.ts | 8 +- packages/shared/src/types/changelog.ts | 2 +- packages/ui/src/badge.tsx | 12 +- 16 files changed, 5215 insertions(+), 34 deletions(-) Fusion-Task-Id: FN-192
This commit is contained in:
2
apps/api/drizzle/0001_charming_quicksand.sql
Normal file
2
apps/api/drizzle/0001_charming_quicksand.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "changelog_entries" DROP COLUMN "stage";
|
||||
ALTER TABLE "changelog_entries" ADD COLUMN "change_type" varchar(20) DEFAULT 'feature' NOT NULL;
|
||||
5167
apps/api/drizzle/meta/0001_snapshot.json
Normal file
5167
apps/api/drizzle/meta/0001_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,13 @@
|
||||
"when": 1778535325959,
|
||||
"tag": "0000_brief_guardian",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "7",
|
||||
"when": 1747039600000,
|
||||
"tag": "0001_charming_quicksand",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ function createMockService(overrides: Record<string, unknown> = {}) {
|
||||
|
||||
const sampleEntry = {
|
||||
id: "entry-1",
|
||||
stage: "prod" as const,
|
||||
changeType: "feature" as const,
|
||||
title: "Deployed v2.3.0",
|
||||
description: "Production deploy completed successfully.",
|
||||
publishedAt: "2026-05-11T12:00:00.000Z",
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type { CreateChangelogEntry, UpdateChangelogEntry, ChangelogStage } from "@sase/shared";
|
||||
export type { CreateChangelogEntry, UpdateChangelogEntry, ChangelogChangeType } from "@sase/shared";
|
||||
|
||||
@@ -49,7 +49,7 @@ const dateObj = new Date(isoDate);
|
||||
|
||||
const sampleEntry = {
|
||||
id: "entry-1",
|
||||
stage: "prod" as const,
|
||||
changeType: "feature" as const,
|
||||
title: "New Feature",
|
||||
description: "A new feature was added.",
|
||||
publishedAt: dateObj,
|
||||
@@ -130,7 +130,7 @@ describe("ChangelogService", () => {
|
||||
const service = new ChangelogService(db as any, redis as any);
|
||||
|
||||
const result = await service.create({
|
||||
stage: "prod",
|
||||
changeType: "feature",
|
||||
title: "New Feature",
|
||||
description: "A new feature was added.",
|
||||
publishedAt: isoDate,
|
||||
|
||||
@@ -57,7 +57,7 @@ export class ChangelogService {
|
||||
const [row] = await this.db
|
||||
.insert(changelogEntries)
|
||||
.values({
|
||||
stage: dto.stage,
|
||||
changeType: dto.changeType,
|
||||
title: dto.title,
|
||||
description: dto.description,
|
||||
publishedAt: new Date(dto.publishedAt),
|
||||
@@ -76,7 +76,7 @@ export class ChangelogService {
|
||||
|
||||
async update(id: string, dto: UpdateChangelogEntry): Promise<ChangelogEntry> {
|
||||
const values: Record<string, unknown> = { updatedAt: new Date() };
|
||||
if (dto.stage !== undefined) values.stage = dto.stage;
|
||||
if (dto.changeType !== undefined) values.changeType = dto.changeType;
|
||||
if (dto.title !== undefined) values.title = dto.title;
|
||||
if (dto.description !== undefined) values.description = dto.description;
|
||||
if (dto.publishedAt !== undefined) values.publishedAt = new Date(dto.publishedAt);
|
||||
|
||||
@@ -433,7 +433,7 @@ export const changelogEntries = pgTable(
|
||||
"changelog_entries",
|
||||
{
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
stage: varchar("stage", { length: 10 }).default("prod").notNull(),
|
||||
changeType: varchar("change_type", { length: 20 }).default("feature").notNull(),
|
||||
title: varchar("title", { length: 255 }).notNull(),
|
||||
description: text("description").notNull(),
|
||||
publishedAt: timestamp("published_at", { withTimezone: true }).notNull(),
|
||||
|
||||
Reference in New Issue
Block a user