refactor: replace client deletion with user detachment and update client schema to support optional user association
This commit is contained in:
@@ -14,6 +14,10 @@ export type FindClientsParams = {
|
||||
status?: boolean;
|
||||
};
|
||||
|
||||
export type DetachClientUserParams = {
|
||||
clientId: string;
|
||||
};
|
||||
|
||||
export type FindClientByIdParams = {
|
||||
id: string;
|
||||
companyId: string;
|
||||
@@ -77,7 +81,7 @@ export type DeleteClientParams = {
|
||||
export interface IClient {
|
||||
id?: string;
|
||||
companyId: string;
|
||||
userId: string;
|
||||
userId?: string;
|
||||
fromClientId: string;
|
||||
status: boolean;
|
||||
firstName: string;
|
||||
@@ -116,6 +120,7 @@ export interface IClientsAdapter {
|
||||
find(filters: FindClientsParams): Promise<IClient[]>;
|
||||
findOne(filters: FindClientsParams): Promise<IClientDocument | null>;
|
||||
paginate(filters: PaginateClientsParams): Promise<PaginateClientsResults>;
|
||||
detachUser(data: DetachClientUserParams): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IClientsManager {
|
||||
|
||||
Reference in New Issue
Block a user