Conversation
…pi into feature/SHOWCASE-145 # Conflicts: # apps/credential-showcase-api-server/src/database/migrations/0000_credential-showcase-api.sql # apps/credential-showcase-api-server/src/types/schema/index.ts # pnpm-lock.yaml
| } | ||
| } | ||
|
|
||
| export const newUserFrom = (user: UserRequest): NewUser => { |
There was a problem hiding this comment.
no this can be removed if we can map something 1:1
There was a problem hiding this comment.
We need a new migration instead of modify the existing one
There was a problem hiding this comment.
Rolled back the changes and created a new migration file
|
I've added few remarks, but looks good |
Brummos
left a comment
There was a problem hiding this comment.
we should also update the diagram with the User Class
| openIdConnectUrl: <https://auth.example.com/.well-known/openid-configuration> | ||
| description: OpenID Connect security scheme for OAuth2 flows | ||
| schemas: | ||
| User: |
There was a problem hiding this comment.
why does user not have an id?
| } | ||
| } | ||
|
|
||
| export const newUserFrom = (user: UserRequest): NewUser => { |
There was a problem hiding this comment.
no this can be removed if we can map something 1:1
| export const userDTOFrom = (user: User): UserDTO => { | ||
| return { | ||
| ...user, | ||
| identifierType: user.identifierType ? user.identifierType : undefined, |
There was a problem hiding this comment.
user.identifierType ?? undefined
There was a problem hiding this comment.
Made it user.identifierType ?? undefined
| return { | ||
| ...user, | ||
| identifierType: user.identifierType ? user.identifierType : undefined, | ||
| identifier: user.identifier ? user.identifier : undefined, |
There was a problem hiding this comment.
user.identifier ?? undefined
There was a problem hiding this comment.
Made it user.identifier ?? undefined
| credentialDefinitions: string[] | ||
| personas: string[] | ||
| bannerImage?: string | null | ||
| createdAt?: string | null |
There was a problem hiding this comment.
this cannot be correct. createdAt is not optional and you are not allowed to pass this into a "new" object. it is auto generated
| example: 2025-03-06T11:30:16.573Z | ||
| UserRequest: | ||
| type: object | ||
| properties: |
There was a problem hiding this comment.
why is identifierType not in here?
There was a problem hiding this comment.
Added the idenfierType
| export const users = pgTable('user', { | ||
| id: uuid('id').notNull().primaryKey().defaultRandom(), | ||
| identifierType: IdentifierTypePg('identifier_type').$type<IdentifierType>(), | ||
| identifier: text('identifier'), |
There was a problem hiding this comment.
you can omit the name as it will take the field name by default and that one is already correct
| '500': | ||
| $ref: '#/components/responses/InternalServerError' | ||
|
|
||
| /users: |
There was a problem hiding this comment.
showcase can now have a user? so i would have expected some changes on the showcase
There was a problem hiding this comment.
Added user to showcase
| "updated_at" timestamp DEFAULT now() NOT NULL, | ||
| CONSTRAINT "scenariosToPersonas_scenario_persona_pk" PRIMARY KEY("scenario","persona") | ||
| ); | ||
|
|
There was a problem hiding this comment.
we need to generate additional migration files. so do not delete the old ones. pull in develop as we already have new files
There was a problem hiding this comment.
Created new migrations files after pulling in the changes
| import { userDTOFrom, newUserFrom } from '../utils/mappers' | ||
| import UserService from '../services/UserService' | ||
|
|
||
| @JsonController('/users') |
There was a problem hiding this comment.
we need to have a controller test
There was a problem hiding this comment.
Created user controller tests
…pi into feature/SHOWCASE-145 # Conflicts: # apps/credential-showcase-api-server/src/database/schema/showcase.ts
…pi into feature/SHOWCASE-145 # Conflicts: # apps/credential-showcase-api-server/src/database/migrations/0003_credential-showcase-api.sql # apps/credential-showcase-api-server/src/database/migrations/meta/_journal.json
PR Deployment URLs ready for review. |
|
|
||
| return { | ||
| ...showcaseResult, | ||
| ...(showcaseResult as any), // TODO check this typing issue at a later point in time |
There was a problem hiding this comment.
the only negative point is this cast as any, but I'll move this PR
There was a problem hiding this comment.
I've spent some time trying to fix it but it didn't work out, so I've just followed the pattern and appended a TODO to the code
No description provided.