import * as data from '../data/index.js';
import * as plugins from '../loint-reception.plugins.js';

export interface IReq_GetUserData
  extends plugins.typedRequestInterfaces.implementsTR<
    plugins.typedRequestInterfaces.ITypedRequest,
    IReq_GetUserData
  > {
  method: 'getUserData';
  request: {
    refreshToken: string;
  };
  response: {
    jwt: string;
  };
}

export interface IReq_SetUserData
  extends plugins.typedRequestInterfaces.implementsTR<
    plugins.typedRequestInterfaces.ITypedRequest,
    IReq_SetUserData
  > {
  method: 'setUserData';
  request: {
    refreshToken: string;
  };
  response: {
    oneTimeTransferCode: string;
  };
}

export interface IReq_SuspendUser
  extends plugins.typedRequestInterfaces.implementsTR<
    plugins.typedRequestInterfaces.ITypedRequest,
    IReq_SuspendUser
  > {
  method: 'suspendUser';
  request: {
    jwt: string;
    userId: string;
  };
  response: {
    publicKeyPem: string;
  };
}

export interface IDeleteSuspendedUser
  extends plugins.typedRequestInterfaces.implementsTR<
    plugins.typedRequestInterfaces.ITypedRequest,
    IDeleteSuspendedUser
  > {
  method: 'deleteSuspendedUser';
  request: {
    backendToken: string;
  };
  response: {
    ok: boolean;
    errorText?: string;
  };
}

export interface IReq_GetRolesAndOrganizationsForUserId
  extends plugins.typedRequestInterfaces.implementsTR<
    plugins.typedRequestInterfaces.ITypedRequest,
    IReq_GetRolesAndOrganizationsForUserId
  > {
  method: 'getRolesAndOrganizationsForUserId';
  request: {
    jwt: string;
    userId: string;
  };
  response: {
    roles: data.IRole[];
    organizations: data.IOrganization[];
  };
}

export interface IReq_WhoIs {
  method: 'whoIs';
  request: {
    jwt: string;
  };
  response: {
    user: data.IUser;
  };
}
