refactor: Abbreviate item rarity values from full names to single-letter codes across the application.
All checks were successful
Deploy to Production / test (push) Successful in 40s

This commit is contained in:
syntaxbullet
2026-02-06 13:00:41 +01:00
parent db4e7313c3
commit 1929f0dd1f
10 changed files with 37 additions and 43 deletions

View File

@@ -59,7 +59,7 @@ export const items = pgTable('items', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 255 }).unique().notNull(),
description: text('description'),
rarity: varchar('rarity', { length: 20 }).default('Common'),
rarity: varchar('rarity', { length: 20 }).default('C'),
// Economy & Visuals
type: varchar('type', { length: 50 }).notNull().default('MATERIAL'),

View File

@@ -16,7 +16,7 @@ import type { ItemType } from "@shared/lib/constants";
export interface CreateItemDTO {
name: string;
description?: string | null;
rarity?: 'Common' | 'Uncommon' | 'Rare' | 'Epic' | 'Legendary';
rarity?: 'C' | 'R' | 'SR' | 'SSR';
type: 'MATERIAL' | 'CONSUMABLE' | 'EQUIPMENT' | 'QUEST';
price?: bigint | null;
iconUrl: string;
@@ -27,7 +27,7 @@ export interface CreateItemDTO {
export interface UpdateItemDTO {
name?: string;
description?: string | null;
rarity?: 'Common' | 'Uncommon' | 'Rare' | 'Epic' | 'Legendary';
rarity?: 'C' | 'R' | 'SR' | 'SSR';
type?: 'MATERIAL' | 'CONSUMABLE' | 'EQUIPMENT' | 'QUEST';
price?: bigint | null;
iconUrl?: string;
@@ -122,7 +122,7 @@ export const itemsService = {
.values({
name: data.name,
description: data.description ?? null,
rarity: data.rarity ?? 'Common',
rarity: data.rarity ?? 'C',
type: data.type,
price: data.price ?? null,
iconUrl: data.iconUrl,