1
0
Fork 0
mirror of synced 2024-09-20 03:08:18 +12:00
budibase/packages/backend-core/tests/utilities/structures/accounts.ts

30 lines
742 B
TypeScript
Raw Normal View History

2022-10-07 04:03:47 +13:00
import { generator, uuid } from "."
import * as db from "../../../src/db/utils"
import { Account, AuthType, CloudAccount, Hosting } from "@budibase/types"
2022-10-07 04:03:47 +13:00
export const account = (): Account => {
2022-10-07 04:03:47 +13:00
return {
accountId: uuid(),
tenantId: generator.word(),
email: generator.email(),
tenantName: generator.word(),
hosting: Hosting.SELF,
2022-10-07 04:03:47 +13:00
createdAt: Date.now(),
verified: true,
verificationSent: true,
tier: "FREE", // DEPRECATED
2022-10-07 04:03:47 +13:00
authType: AuthType.PASSWORD,
name: generator.name(),
size: "10+",
profession: "Software Engineer",
}
}
export const cloudAccount = (): CloudAccount => {
return {
...account(),
hosting: Hosting.CLOUD,
2022-10-07 04:03:47 +13:00
budibaseUserId: db.generateGlobalUserID(),
}
}