Effect CommunityEC
Effect Community2y ago
11 replies
TashTolo

Integrating Effect Schema with Dynamoose: Seeking Guidance

Hi there. Does anyone use effect schema with dynamoose? I'm trying to figure out how to integrate schema in such setup. Any ideas?

import { UserType, UserDistributionStatus } from 'src/users/user.entity'

import { Attribute } from '../dynamo-db/attribute.decorator'
import { Entity } from '../dynamo-db/entity.decorator'

@Entity({
  tableName: 'APP_DYN_DOMAIN_USERS_TABLENAME',
})
export class DomainUserEntity {
  @Attribute({ type: String, required: true, hashKey: true })
  cognitoId: string

  @Attribute({ type: String, required: true })
  firstName: string

  @Attribute({ type: String, required: true })
  lastName: string

  @Attribute({ type: String, required: true })
  email: string

  @Attribute({
    type: String,
    required: true,
  })
  userType: UserType
}
Was this page helpful?