Skip to content

Commit b9838e7

Browse files
committed
docs: add comment about different user entities
1 parent ed8d568 commit b9838e7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • packages/apps/reputation-oracle/server/src/modules/user

packages/apps/reputation-oracle/server/src/modules/user/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { SetNonNullable } from 'type-fest';
22
import { UserEntity } from './user.entity';
33

4+
/**
5+
* ATM UserEntity is used to store two different domain objects
6+
* that have intersection in properties:
7+
* = Operator - aka "Oracle"; it should be authorized using web3 signature
8+
* and always has evmAddres, but never has email, password and some other fields
9+
* - Web2User - is "Worker", admin user and HUMAN App; they always
10+
* have email & password, but might not have evmAddress
11+
*
12+
* Until we split the DB model - we differentiate them in code using differen types.
13+
*/
14+
415
export type Web2UserEntity = SetNonNullable<UserEntity, 'email' | 'password'>;
516

617
export type OperatorUserEntity = SetNonNullable<

0 commit comments

Comments
 (0)