Add business registration requests with approval flow, SMS notifications, and owner businesses endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-23 18:13:09 +03:30
co-authored by Cursor
parent 97a9ee022f
commit aa990c3204
14 changed files with 611 additions and 3 deletions
+26
View File
@@ -0,0 +1,26 @@
export function slugifyTitle(value: string): string {
return value
.trim()
.toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^a-z0-9-]/g, '')
.replace(/-+/g, '-')
.replace(/^-|-$/g, '');
}
export async function uniqueBusinessSlug(
title: string,
exists: (slug: string) => Promise<boolean>,
): Promise<string> {
let base = slugifyTitle(title);
if (!base) {
base = 'business';
}
let slug = base;
let suffix = 0;
while (await exists(slug)) {
suffix += 1;
slug = `${base}-${suffix}`;
}
return slug;
}