2023-07-13 23:36:50 +12:00
|
|
|
import { generator } from "../../shared"
|
|
|
|
import { Hosting, CreateAccountRequest } from "@budibase/types"
|
|
|
|
|
2023-07-19 08:15:13 +12:00
|
|
|
// TODO: Refactor me to central location
|
2023-07-25 22:28:14 +12:00
|
|
|
export const generateAccount = (
|
|
|
|
partial: Partial<CreateAccountRequest>
|
|
|
|
): CreateAccountRequest => {
|
|
|
|
const uuid = generator.guid()
|
2023-07-13 23:36:50 +12:00
|
|
|
|
2023-07-20 02:42:12 +12:00
|
|
|
const email = `${uuid}@budibase.com`
|
|
|
|
const tenant = `tenant${uuid.replace(/-/g, "")}`
|
2023-07-13 23:36:50 +12:00
|
|
|
|
2023-07-25 22:28:14 +12:00
|
|
|
return {
|
|
|
|
email,
|
|
|
|
hosting: Hosting.CLOUD,
|
|
|
|
name: email,
|
|
|
|
password: uuid,
|
|
|
|
profession: "software_engineer",
|
|
|
|
size: "10+",
|
|
|
|
tenantId: tenant,
|
|
|
|
tenantName: tenant,
|
|
|
|
...partial,
|
|
|
|
}
|
2023-07-13 23:36:50 +12:00
|
|
|
}
|