feat: API org user scope (#15739)

* Init organizations users GET endpoint

* Fix get users endpoint

* Add create user input

* Add POST to organization user endpoint

* Creating a user make email mandatory

* Move DTOs out of platform types

* Use plainToInstance for data filtering

* POST create user and org membership

* Add email check

* Filter update user call

* Add getOrg decorator to endpoints

* Add update endpoint

* Add delete endpoint

* Fix merge changes to create new org user

* Init tests

* Send org signup email

* Abstract username check

* Implement email service

* WIP E2E test

* Rename methods

* Update update org user DTO

* Remove unused inputs

* chore: add ApiProperty decorator to users class validators

* Type fix

* Update tests

* chore: code review comments

* chore: code review comments

* chore: code review comments

---------

Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-07-16 10:50:46 +00:00
1 parent 9fec77e345
commit 41cde8e384
23 files changed
+1743 -3

No files matched your search

@@ -0,0 +1,17 @@
import { CreateUserInput } from "@/modules/users/inputs/create-user.input";
import { MembershipRole } from "@prisma/client";
import { IsString, IsOptional, IsBoolean, IsEnum } from "class-validator";
export class CreateOrganizationUserInput extends CreateUserInput {
@IsOptional()
@IsString()
locale = "en";
@IsOptional()
@IsEnum(MembershipRole)
organizationRole: MembershipRole = MembershipRole.MEMBER;
@IsOptional()
@IsBoolean()
autoAccept = true;
}
@@ -0,0 +1,3 @@
import { GetUsersInput } from "@/modules/users/inputs/get-users.input";
export class GetOrganizationsUsersInput extends GetUsersInput {}
@@ -0,0 +1,3 @@
import { UpdateUserInput } from "@/modules/users/inputs/update-user.input";
export class UpdateOrganizationUserInput extends UpdateUserInput {}