Skip to content

Commit

Permalink
Merge pull request #271 from code4romania/tamariei/teo-to-vic
Browse files Browse the repository at this point in the history
Change all references from Teo to Vic
  • Loading branch information
birloiflorian authored Mar 7, 2024
2 parents 4beed2c + 5ed62c3 commit 3a77b41
Show file tree
Hide file tree
Showing 33 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- '5432:5432'
environment:
POSTGRES_PASSWORD: pass123
POSTGRES_DB: teo
POSTGRES_DB: vic
redis:
image: redis:latest
ports:
Expand Down
4 changes: 2 additions & 2 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "teo-backend",
"name": "vic-backend",
"version": "0.17.11",
"description": "",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
import { Expose } from 'class-transformer';
import { ITeoStatistics } from 'src/modules/dashboard/model/dashboard.model';
import { IVicStatistics } from 'src/modules/dashboard/model/dashboard.model';

export class TeoStatisticsPresenter {
constructor(statistics: ITeoStatistics) {
export class VicStatisticsPresenter {
constructor(statistics: IVicStatistics) {
this.numberOfActiveVolunteers = statistics.numberOfActiveVolunteers;
this.numberOfOrganizations = statistics.numberOfOrganizations;
}
Expand Down
14 changes: 7 additions & 7 deletions backend/src/api/_mobile/statistics/statistics.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import { MobileJwtAuthGuard } from 'src/modules/auth/guards/jwt-mobile.guard';
import { IRegularUserModel } from 'src/modules/user/models/regular-user.model';
import { GetVolunteerMonthlyNewsStatisticsUsecase } from 'src/usecases/dashboard/get-volunteer-monthly-news.usecase';
import { MonthlyStatisticsPresenter } from './presenters/monthly-statistics.presenter';
import { GetTeoStatisticsUsecase } from 'src/usecases/dashboard/get-teo-statistics.usecase';
import { TeoStatisticsPresenter } from './presenters/teo-statistics.presenter';
import { GetVicStatisticsUsecase } from 'src/usecases/dashboard/get-vic-statistics.usecase';
import { VicStatisticsPresenter } from './presenters/vic-statistics.presenter';

@ApiBearerAuth()
@UseGuards(MobileJwtAuthGuard)
@Controller('mobile/statistics')
export class MobileStatisticsController {
constructor(
private readonly getVolunteerMonthlyNewsStatisticsUsecase: GetVolunteerMonthlyNewsStatisticsUsecase,
private readonly getTeoStatisticsUsecase: GetTeoStatisticsUsecase,
private readonly getVicStatisticsUsecase: GetVicStatisticsUsecase,
) {}

@Get('monthly')
Expand All @@ -28,10 +28,10 @@ export class MobileStatisticsController {
return new MonthlyStatisticsPresenter(statistics);
}

@Get('teo')
async getTeoStatistics(): Promise<TeoStatisticsPresenter> {
const statistics = await this.getTeoStatisticsUsecase.execute();
@Get('vic')
async getVicStatistics(): Promise<VicStatisticsPresenter> {
const statistics = await this.getVicStatisticsUsecase.execute();

return new TeoStatisticsPresenter(statistics);
return new VicStatisticsPresenter(statistics);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Expose } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { IDashaboardVolunteersGrouped } from 'src/modules/dashboard/model/dashboard.model';
import { IDashboardVolunteersGrouped } from 'src/modules/dashboard/model/dashboard.model';

export class VolunteersGroupedPresenter {
constructor(data: IDashaboardVolunteersGrouped) {
constructor(data: IDashboardVolunteersGrouped) {
this.name = data.name;
this.count = data.count;
}
Expand Down
20 changes: 10 additions & 10 deletions backend/src/common/constants/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const NOTIFICATIONS = {
APPROVE_ACCESS_REQUEST: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`Cererea de înscriere în organizația ${organizationName} a fost aprobată`,
},
Expand All @@ -13,7 +13,7 @@ export const NOTIFICATIONS = {
},
REJECT_ACCESS_REQUEST: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`Cererea de înscriere în organizația ${organizationName} a fost respinsă`,
},
Expand All @@ -25,7 +25,7 @@ export const NOTIFICATIONS = {
},
ARCHIVE_VOLUNTEER: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`${organizationName} a dezactivat contul tău din organizație. Pentru detalii te rugăm să contactezi direct organizația.`,
},
Expand All @@ -37,7 +37,7 @@ export const NOTIFICATIONS = {
},
NEW_EVENT: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`Organizația ${organizationName} a adăugat un eveniment nou`,
},
Expand All @@ -49,21 +49,21 @@ export const NOTIFICATIONS = {
},
APPROVED_HOURS: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (hours: number, date: string): string =>
`${hours} ore de voluntariat din ${date} au fost aprobate`,
},
},
REJECTED_HOURS: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (hours: number, date: string): string =>
`${hours} ore de voluntariat din ${date} au fost respinse`,
},
},
NEW_CONTRACT: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`${organizationName} ți-a generat contractul de voluntariat. Intră în aplicație și descarcă documentul.`,
},
Expand All @@ -75,7 +75,7 @@ export const NOTIFICATIONS = {
},
REJECT_CONTRACT: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string, reason: string): string =>
`Contractul tău cu ${organizationName} a fost respins. Motiv: ${reason}`,
},
Expand All @@ -87,7 +87,7 @@ export const NOTIFICATIONS = {
},
APPROVE_CONTRACT: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`Contractul tău cu ${organizationName} a fost aprobat. Descarcă documentul direct din aplicație`,
},
Expand All @@ -99,7 +99,7 @@ export const NOTIFICATIONS = {
},
NEW_ANNOUCEMENT: {
PUSH: {
title: 'TEO',
title: 'VIC',
body: (organizationName: string): string =>
`Ai un mesaj nou de la ${organizationName}`,
},
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async function bootstrap(): Promise<void> {
// Create swagger module only local or development
if (!(process.env.NODE_ENV === Environment.Production)) {
const options = new DocumentBuilder()
.setTitle('TEO API Documentation')
.setDescription('TEO API Documentation')
.setTitle('VIC API Documentation')
.setDescription('VIC API Documentation')
.setVersion('1.0')
.addBearerAuth()
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
FindDashboardVolunteerStatusChartOptions,
FindDashboardVolunteersGrouped,
IDashaboardVolunteersGrouped,
IDashboardVolunteersGrouped,
IDashboardVolunteerStatusTimeseries,
IDashboardVolunteersHours,
IDashboardVolunteersStatus,
Expand All @@ -13,7 +13,7 @@ export interface IDashboardRepository {
): Promise<IDashboardVolunteerStatusTimeseries[]>;
findVolunteersStatisticsGrouped(
findOptions: FindDashboardVolunteersGrouped,
): Promise<IDashaboardVolunteersGrouped[]>;
): Promise<IDashboardVolunteersGrouped[]>;
countVolunteersHours(
organizationId: string,
): Promise<IDashboardVolunteersHours>;
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/dashboard/model/dashboard.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface IDashboardVolunteerStatusTimeseries {
archived: number;
}

export interface IDashaboardVolunteersGrouped {
export interface IDashboardVolunteersGrouped {
name: string;
count: number;
}
Expand Down Expand Up @@ -39,7 +39,7 @@ export interface IVolunteerMonthlyStatistics {
numberOfOrganizationUpdates: number;
}

export interface ITeoStatistics {
export interface IVicStatistics {
numberOfActiveVolunteers: number;
numberOfOrganizations: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IDashboardRepository } from '../interfaces/dashboard-volunteer-status-r
import {
FindDashboardVolunteersGrouped,
FindDashboardVolunteerStatusChartOptions,
IDashaboardVolunteersGrouped,
IDashboardVolunteersGrouped,
IDashboardVolunteersHours,
IDashboardVolunteersStatus,
IDashboardVolunteerStatusTimeseries,
Expand Down Expand Up @@ -64,7 +64,7 @@ export class DashboardRepository implements IDashboardRepository {

async findVolunteersStatisticsGrouped(
findOptions: FindDashboardVolunteersGrouped,
): Promise<IDashaboardVolunteersGrouped[]> {
): Promise<IDashboardVolunteersGrouped[]> {
const query = this.volunteerRepository
.createQueryBuilder('v')
.leftJoin('v.user', 'u')
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/dashboard/services/dashboard.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import {
FindDashboardVolunteersGrouped,
FindDashboardVolunteerStatusChartOptions,
IDashaboardVolunteersGrouped,
IDashboardVolunteersGrouped,
IDashboardVolunteersHours,
IDashboardVolunteersStatus,
IDashboardVolunteerStatusTimeseries,
Expand All @@ -23,7 +23,7 @@ export class DashboardFacade {

async findVolunteersStatisticsGrouped(
findOptions: FindDashboardVolunteersGrouped,
): Promise<IDashaboardVolunteersGrouped[]> {
): Promise<IDashboardVolunteersGrouped[]> {
return this.dashboardRepository.findVolunteersStatisticsGrouped(
findOptions,
);
Expand Down
8 changes: 4 additions & 4 deletions backend/src/modules/onghub/services/ong-hub.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export class OngHubService {
) {}

// Get user and organization data from OngHub
// Because both Teo and OngHub refers to the same user pool the same token used in one can authorize a request in the other
// Because both Vic and OngHub refers to the same user pool the same token used in one can authorize a request in the other

// cognito_user_id - user id of an admin user in TEO and a Admin/Employee user in OngHub
// access_token - token sent by the Teo Web Client for requesting the user profile
// cognito_user_id - user id of an admin user in VIC and a Admin/Employee user in OngHub
// access_token - token sent by the Vic Web Client for requesting the user profile

// This should be called on first user login where there is no data related to the user an it's organization in the TEO DB.
// This should be called on first user login where there is no data related to the user an it's organization in the VIC DB.
public async getUserAndOrganizationDataFromOngHub(
access_token: string,
): Promise<IUserWithOrganizationModel> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import { Injectable } from '@nestjs/common';
import { IUseCaseService } from 'src/common/interfaces/use-case-service.interface';
import {
FindDashboardVolunteersGrouped,
IDashaboardVolunteersGrouped,
IDashboardVolunteersGrouped,
} from 'src/modules/dashboard/model/dashboard.model';
import { DashboardFacade } from 'src/modules/dashboard/services/dashboard.facade';

@Injectable()
export class GetDashboardVolunteerGroupedUsecase
implements IUseCaseService<IDashaboardVolunteersGrouped[]>
implements IUseCaseService<IDashboardVolunteersGrouped[]>
{
constructor(private readonly dashboardFacade: DashboardFacade) {}

public async execute(
findOptions: FindDashboardVolunteersGrouped,
): Promise<IDashaboardVolunteersGrouped[]> {
): Promise<IDashboardVolunteersGrouped[]> {
return this.dashboardFacade.findVolunteersStatisticsGrouped(findOptions);
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { Injectable } from '@nestjs/common';
import { IUseCaseService } from 'src/common/interfaces/use-case-service.interface';
import { ITeoStatistics } from 'src/modules/dashboard/model/dashboard.model';
import { IVicStatistics } from 'src/modules/dashboard/model/dashboard.model';
import { OrganizationFacadeService } from 'src/modules/organization/services/organization.facade';
import { VolunteerStatus } from 'src/modules/volunteer/enums/volunteer-status.enum';
import { VolunteerFacade } from 'src/modules/volunteer/services/volunteer.facade';

@Injectable()
export class GetTeoStatisticsUsecase
implements IUseCaseService<ITeoStatistics>
export class GetVicStatisticsUsecase
implements IUseCaseService<IVicStatistics>
{
constructor(
private readonly organizationFacade: OrganizationFacadeService,
private readonly volunteerFacade: VolunteerFacade,
) {}

public async execute(): Promise<ITeoStatistics> {
public async execute(): Promise<IVicStatistics> {
const numberOfActiveVolunteers = await this.volunteerFacade.count({
status: VolunteerStatus.ACTIVE,
});
Expand Down
6 changes: 3 additions & 3 deletions backend/src/usecases/use-case.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import { GetVolunteerPendingContractsUsecase } from './documents/get-volunteer-p
import { CancelContractUsecase } from './documents/cancel-contract.usecase';
import { UpdateRegularUserUsecase } from './user/update-regular-user.usecase';
import { GetVolunteerMonthlyNewsStatisticsUsecase } from './dashboard/get-volunteer-monthly-news.usecase';
import { GetTeoStatisticsUsecase } from './dashboard/get-teo-statistics.usecase';
import { GetVicStatisticsUsecase } from './dashboard/get-vic-statistics.usecase';
import { GetManyAnouncementsByUserAsUsecase } from './announcement/get-many-anouncements-by-user.usecase';
import { LeaveOrganizationUsecase } from './organization/leave-organization.usecase';
import { RejoinOrganizationUsecase } from './organization/rejoin-organization.usecase';
Expand Down Expand Up @@ -272,7 +272,7 @@ import { DeleteAccountRegularUserUsecase } from './user/delete-account.usecase';
RegisterDevicePushTokenUseCase,
UnregisterDevicePushTokenUseCase,
GetVolunteerMonthlyNewsStatisticsUsecase,
GetTeoStatisticsUsecase,
GetVicStatisticsUsecase,
// Templates
CreateTemplateUsecase,
GetTemplatesUsecase,
Expand Down Expand Up @@ -438,7 +438,7 @@ import { DeleteAccountRegularUserUsecase } from './user/delete-account.usecase';
GetVolunteerContractHistoryUsecase,
GetVolunteerPendingContractsUsecase,
CancelContractUsecase,
GetTeoStatisticsUsecase,
GetVicStatisticsUsecase,
// Notifications
UpdateSettingsUsecase,
],
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "teo-frontend",
"name": "vic-frontend",
"private": true,
"version": "0.12.12",
"type": "module",
Expand Down
Loading

0 comments on commit 3a77b41

Please sign in to comment.