B2B-88: add starter kit structure and elements

This commit is contained in:
devmc-ee
2025-06-08 16:18:30 +03:00
parent 657a36a298
commit e7b25600cb
1280 changed files with 77893 additions and 5688 deletions

View File

@@ -0,0 +1,50 @@
import { z } from 'zod';
/**
* @name RESERVED_NAMES_ARRAY
* @description Array of reserved names for team accounts
* This is a list of names that cannot be used for team accounts as they are reserved for other purposes.
* Please include any new reserved names here.
*/
const RESERVED_NAMES_ARRAY = [
'settings',
'billing',
// please add more reserved names here
];
const SPECIAL_CHARACTERS_REGEX = /[!@#$%^&*()+=[\]{};':"\\|,.<>/?]/;
/**
* @name TeamNameSchema
*/
export const TeamNameSchema = z
.string({
description: 'The name of the team account',
})
.min(2)
.max(50)
.refine(
(name) => {
console.log(name);
return !SPECIAL_CHARACTERS_REGEX.test(name);
},
{
message: 'teams:specialCharactersError',
},
)
.refine(
(name) => {
return !RESERVED_NAMES_ARRAY.includes(name.toLowerCase());
},
{
message: 'teams:reservedNameError',
},
);
/**
* @name CreateTeamSchema
* @description Schema for creating a team account
*/
export const CreateTeamSchema = z.object({
name: TeamNameSchema,
});