@prisma/client#Account TypeScript Examples

The following examples show how to use @prisma/client#Account. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: account.service.spec.ts    From amplication with Apache License 2.0 6 votes vote down vote up
EXAMPLE_ACCOUNT: Account = {
  id: EXAMPLE_ACCOUNT_ID,
  createdAt: new Date(),
  updatedAt: new Date(),
  email: EXAMPLE_EMAIL,
  firstName: EXAMPLE_FIRST_NAME,
  lastName: EXAMPLE_LAST_NAME,
  password: EXAMPLE_PASSWORD,
  currentUserId: EXAMPLE_CURRENT_USER_ID,
  githubId: null
}
Example #2
Source File: account.service.ts    From amplication with Apache License 2.0 6 votes vote down vote up
async createAccount(args: Prisma.AccountCreateArgs): Promise<Account> {
    const account = await this.prisma.account.create(args);
    await this.analytics.identify({
      userId: account.id,
      createdAt: account.createdAt,
      email: account.email,
      firstName: account.firstName,
      lastName: account.lastName
    });
    await this.analytics.track({
      userId: account.id,
      event: EnumEventType.Signup
    });
    return account;
  }
Example #3
Source File: auth.service.spec.ts    From amplication with Apache License 2.0 6 votes vote down vote up
EXAMPLE_ACCOUNT: Account = {
  id: 'alice',
  email: '[email protected]',
  password: 'PASSWORD',
  firstName: 'Alice',
  lastName: 'Appleseed',
  createdAt: new Date(),
  updatedAt: new Date(),
  currentUserId: null,
  githubId: null
}
Example #4
Source File: account.service.ts    From amplication with Apache License 2.0 5 votes vote down vote up
findAccount(args: Prisma.AccountFindUniqueArgs): Promise<Account> {
    return this.prisma.account.findUnique(args);
  }
Example #5
Source File: account.service.ts    From amplication with Apache License 2.0 5 votes vote down vote up
updateAccount(args: Prisma.AccountUpdateArgs): Promise<Account> {
    return this.prisma.account.update(args);
  }
Example #6
Source File: account.service.ts    From amplication with Apache License 2.0 5 votes vote down vote up
async setPassword(accountId: string, password: string): Promise<Account> {
    return this.prisma.account.update({
      data: {
        password
      },
      where: { id: accountId }
    });
  }
Example #7
Source File: auth.service.spec.ts    From amplication with Apache License 2.0 5 votes vote down vote up
EXAMPLE_ACCOUNT_WITH_CURRENT_USER: Account & { currentUser: User } = {
  ...EXAMPLE_ACCOUNT,
  currentUser: EXAMPLE_USER
}
Example #8
Source File: auth.service.spec.ts    From amplication with Apache License 2.0 5 votes vote down vote up
EXAMPLE_ACCOUNT_WITH_CURRENT_USER_WITH_ROLES_AND_WORKSPACE: Account & {
  currentUser: AuthUser;
} = {
  ...EXAMPLE_ACCOUNT,
  currentUser: EXAMPLE_AUTH_USER
}