Update system name and references from TeaBoy to Tx

Replaces all user-facing instances of "TeaBoy" with "Tx" across the application, including titles, locale files, database settings, seed data, and API documentation. Also updates internal storage keys and session secrets to remove the old branding.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 07b19cb0-11b5-4be9-8932-ae4820eb73b8
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/HxTkDPZ
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-04-22 10:26:53 +00:00
parent 6dd927350d
commit 1f23e65c0b
18 changed files with 57 additions and 43 deletions
+1 -1
View File
@@ -3,6 +3,6 @@ set -e
pnpm install --frozen-lockfile
pnpm --filter db run push-force
# Idempotent: ensure the default groups exist and existing users are mapped
# (Admins, TeaBoy, Everyone). Safe to run repeatedly.
# (Admins, Tx, Everyone). Safe to run repeatedly.
pnpm --filter scripts run seed
pnpm --filter @workspace/teaboy-os exec playwright install chromium
+23 -11
View File
@@ -102,7 +102,7 @@ async function main() {
.insert(usersTable)
.values({
username: "admin",
email: "admin@teaboy.local",
email: "admin@tx.local",
passwordHash: adminHash,
displayNameAr: "مدير النظام",
displayNameEn: "System Admin",
@@ -118,7 +118,7 @@ async function main() {
.insert(usersTable)
.values({
username: "ahmed",
email: "ahmed@teaboy.local",
email: "ahmed@tx.local",
passwordHash: userHash,
displayNameAr: "أحمد محمد",
displayNameEn: "Ahmed Mohammed",
@@ -369,7 +369,7 @@ async function main() {
isSystem: 1,
},
{
name: "TeaBoy",
name: "Tx",
descriptionAr: "فريق إعداد وتقديم الطلبات",
descriptionEn: "Team that prepares and delivers orders",
isSystem: 1,
@@ -383,9 +383,21 @@ async function main() {
])
.onConflictDoNothing();
// One-time migration: rename legacy "TeaBoy" group to "Tx" if it still exists
// and the new "Tx" group hasn't been created yet.
const existingGroups = await db.select().from(groupsTable);
const legacy = existingGroups.find((g) => g.name === "TeaBoy");
const newOne = existingGroups.find((g) => g.name === "Tx");
if (legacy && !newOne) {
await db
.update(groupsTable)
.set({ name: "Tx" })
.where(eq(groupsTable.id, legacy.id));
}
const allGroups = await db.select().from(groupsTable);
const adminsGroup = allGroups.find((g) => g.name === "Admins");
const teaboyGroup = allGroups.find((g) => g.name === "TeaBoy");
const txGroup = allGroups.find((g) => g.name === "Tx");
const everyoneGroup = allGroups.find((g) => g.name === "Everyone");
const allRolesNow = await db.select().from(rolesTable);
@@ -399,10 +411,10 @@ async function main() {
.values({ groupId: adminsGroup.id, roleId: adminRoleNow.id })
.onConflictDoNothing();
}
if (teaboyGroup && orderReceiverNow) {
if (txGroup && orderReceiverNow) {
await db
.insert(groupRolesTable)
.values({ groupId: teaboyGroup.id, roleId: orderReceiverNow.id })
.values({ groupId: txGroup.id, roleId: orderReceiverNow.id })
.onConflictDoNothing();
}
@@ -414,13 +426,13 @@ async function main() {
.values(allAppsNow.map((a) => ({ groupId: adminsGroup.id, appId: a.id })))
.onConflictDoNothing();
}
// TeaBoy gets the services app (which is where receivers see incoming orders)
if (teaboyGroup) {
// The Tx receivers group gets the services app (where receivers see incoming orders)
if (txGroup) {
const servicesApp = allAppsNow.find((a) => a.slug === "services");
if (servicesApp) {
await db
.insert(groupAppsTable)
.values({ groupId: teaboyGroup.id, appId: servicesApp.id })
.values({ groupId: txGroup.id, appId: servicesApp.id })
.onConflictDoNothing();
}
}
@@ -447,7 +459,7 @@ async function main() {
}
}
if (teaboyGroup && orderReceiverNow) {
if (txGroup && orderReceiverNow) {
const receiverRows = await db
.select({ userId: userRolesTable.userId })
.from(userRolesTable)
@@ -455,7 +467,7 @@ async function main() {
if (receiverRows.length > 0) {
await db
.insert(userGroupsTable)
.values(receiverRows.map((r) => ({ userId: r.userId, groupId: teaboyGroup.id })))
.values(receiverRows.map((r) => ({ userId: r.userId, groupId: txGroup.id })))
.onConflictDoNothing();
}
}