feat(FN-192): DB schema + Migration (+7 more)
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:
Fusion
2026-05-12 06:13:18 +00:00
parent c9c168b89c
commit 0f80f5292b
16 changed files with 5215 additions and 34 deletions

View 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;

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,13 @@
"when": 1778535325959,
"tag": "0000_brief_guardian",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1747039600000,
"tag": "0001_charming_quicksand",
"breakpoints": true
}
]
}
}

View File

@@ -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",

View File

@@ -1 +1 @@
export type { CreateChangelogEntry, UpdateChangelogEntry, ChangelogStage } from "@sase/shared";
export type { CreateChangelogEntry, UpdateChangelogEntry, ChangelogChangeType } from "@sase/shared";

View File

@@ -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,

View File

@@ -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);

View File

@@ -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(),