Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-service): WIP - fetch user active sessions #7404

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .source
3 changes: 3 additions & 0 deletions apps/api/src/app/support/usecases/plain-cards.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export class PlainCardsUsecase {
}
const organizations = await this.organizationRepository.findUserActiveOrganizations(command?.customer?.externalId);

const sessions = await this.organizationRepository.findUseActiveSessions(command?.customer?.externalId);

console.log('sessions ==>', sessions);
const organizationsComponent = organizations?.map((organization) => {
return {
componentContainer: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class CommunityOrganizationRepository
});
}

async findUseActiveSessions(userId: string): Promise<[]> {
throw new Error('Not implemented');
}

private async getUsersMembersOrganizationIds(userId: string): Promise<string[]> {
const members = await this.memberRepository.findUserActiveMembers(userId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IPartnerConfiguration, OrganizationEntity } from './organization.entity
export interface IOrganizationRepository extends IOrganizationRepositoryMongo {
findById(id: string, select?: string): Promise<OrganizationEntity | null>;
findUserActiveOrganizations(userId: string): Promise<OrganizationEntity[]>;
findUseActiveSessions(userId: string): Promise<[]>;
updateBrandingDetails(
organizationId: string,
branding: { color: string; logo: string }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export class OrganizationRepository implements IOrganizationRepository {
return this.organizationRepository.findUserActiveOrganizations(userId);
}

findUseActiveSessions(userId: string): Promise<[]> {
return this.organizationRepository.findUseActiveSessions(userId);
}

updateBrandingDetails(organizationId: string, branding: { color: string; logo: string }) {
return this.organizationRepository.updateBrandingDetails(organizationId, branding);
}
Expand Down
Loading