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

Production release #636

Merged
merged 84 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
642872a
feat: [438] yearly job to add financial reports, reports, partners, i…
radulescuandrew Jul 26, 2024
18836d4
feat: [517] add search and sort by alias instead of name
dragos1195 Aug 5, 2024
4ae6a1a
feat: [476] wip edit application + label
dragos1195 Aug 7, 2024
a8bf1e9
feat: [476] wip application label
dragos1195 Aug 12, 2024
d680de2
feat: [476] working version
dragos1195 Aug 12, 2024
5a463a1
feat: [476] remove console log
dragos1195 Aug 13, 2024
819271b
feat: [476] remove console log
dragos1195 Aug 13, 2024
9825a2b
fix: [584] add correct mapping for organizationCities
dragos1195 Aug 14, 2024
876fc78
Merge branch 'develop' into feat/438
radulescuandrew Aug 14, 2024
293b1a1
feat: [476] fix comments
dragos1195 Aug 14, 2024
05340f4
feat: [438] Send email on 1st of June to all NGOs with Financial Data…
radulescuandrew Aug 14, 2024
8031f6c
feat: [476] add errors for more than 30 chars
dragos1195 Aug 14, 2024
6711a7f
feat: [476] add missing property from interface
dragos1195 Aug 14, 2024
b0813af
feat: [584] add handles for change county
dragos1195 Aug 14, 2024
87f2b16
fix: [584] fix the handles
dragos1195 Aug 14, 2024
b0f580f
Merge pull request #605 from code4romania/feature/517
dragos1195 Aug 14, 2024
8d87c2c
fix: [584] fix for create organization
dragos1195 Aug 14, 2024
075f533
Merge pull request #608 from code4romania/476
dragos1195 Aug 14, 2024
bcabb10
Merge pull request #610 from code4romania/fix/C4R-584
dragos1195 Aug 14, 2024
bcc7923
Merge branch 'develop' into feat/438
radulescuandrew Aug 19, 2024
4fd64b8
feat: [438] Add new migration for status
radulescuandrew Aug 19, 2024
e06212a
feat: [438] Generate financial data and the other reports only if the…
radulescuandrew Aug 19, 2024
b1dc814
feat: [438] Decouple CompletionStatus from organization, update FE st…
radulescuandrew Aug 21, 2024
cbee03f
feat: [438] Exclude PENDING from errored financial reports in the org…
radulescuandrew Aug 21, 2024
2d35ff2
wip: banners, tooltip, new dashboard statistics card
luciatugui Aug 21, 2024
2d91924
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
luciatugui Aug 21, 2024
f7ad490
fix [#600]: broken safari landing page
luciatugui Aug 21, 2024
2ee4551
wip 495 comm fixes
dragos1195 Aug 21, 2024
bfb9328
Merge pull request #614 from code4romania/fix/600
luciatugui Aug 22, 2024
2549ca2
feat: [438] Fetch ANAF API for organization with financial reports m…
radulescuandrew Aug 22, 2024
44aebb6
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
radulescuandrew Aug 22, 2024
e74c6b7
style: dashboard cards & translations
luciatugui Aug 22, 2024
49b635e
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
luciatugui Aug 22, 2024
abde740
feat: [495-1] fix comments
dragos1195 Aug 22, 2024
f96b891
feat: [495-1] fix comments for PR
dragos1195 Aug 22, 2024
05ca933
Merge pull request #615 from code4romania/feat/495-1
dragos1195 Aug 22, 2024
bececb3
feat: [438] Fix wrong calculation on reports CompletionStatus on Orga…
radulescuandrew Aug 22, 2024
fa6b871
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
radulescuandrew Aug 22, 2024
d9dd7a8
fix: [611] add checks for addresses of create/edit organization general
dragos1195 Aug 22, 2024
661a839
Merge pull request #617 from code4romania/chore/translations-updates
birloiflorian Aug 22, 2024
d7c0126
feat: [438] Send email on 1st of june to all organizations with missi…
radulescuandrew Aug 22, 2024
25e11b9
Merge pull request #616 from code4romania/fix/611
dragos1195 Aug 22, 2024
8638bc4
feat: [438] Send notification to NGO admins after we get data from AN…
radulescuandrew Aug 22, 2024
7840df4
style: modify success and warning tooltip colors
luciatugui Aug 22, 2024
d855231
feat: [438] add weekly reminder cron for reports
dragos1195 Aug 22, 2024
dd409fb
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
dragos1195 Aug 22, 2024
d268eec
feat: [438] Remove 2y logic for generating reports
radulescuandrew Aug 27, 2024
51cd955
fix: [611] fix selected option for controlled inputs
dragos1195 Aug 27, 2024
a66bbaf
feat: [438] New API to retrieve errored reports and FE integration
radulescuandrew Aug 27, 2024
aba3eed
Merge pull request #618 from code4romania/fix/611-1
radulescuandrew Aug 27, 2024
31b6a7b
fix: actionLink on banner & superAdmin app dashboard cards
luciatugui Aug 27, 2024
6f9fce1
feat: [438] Add testing APIs
radulescuandrew Aug 27, 2024
783fd10
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
radulescuandrew Aug 27, 2024
ccc6c33
fix: zIndex on tooltip
luciatugui Aug 27, 2024
1c503b0
Merge branch 'feat/438' of github.com:code4romania/onghub into feat/438
luciatugui Aug 27, 2024
0656ebe
Merge pull request #619 from code4romania/feat/438
radulescuandrew Aug 27, 2024
31befdd
fix: [611] remove semibold option + add id selection optional
dragos1195 Aug 28, 2024
ea72ccb
Merge pull request #621 from code4romania/fix/611-2
dragos1195 Aug 28, 2024
4f3b4f6
fix: [344] make user phone not mandatory
dragos1195 Aug 29, 2024
67b4a83
fix: [438] prevent errors while attempting to delete undefined reports
dragos1195 Aug 29, 2024
fede900
fix: [438] prevent generation of reports for organizations that have …
dragos1195 Aug 29, 2024
80d006d
fix: [438] add correct if
dragos1195 Aug 29, 2024
ff8eb83
Merge pull request #623 from code4romania/fix/344
dragos1195 Aug 29, 2024
098ab71
Merge pull request #624 from code4romania/fix/438-1
dragos1195 Aug 29, 2024
9a58995
Merge pull request #625 from code4romania/fix/438-2
dragos1195 Aug 29, 2024
e52284c
bugfix: Handle status and last update for inexistent reports for an o…
radulescuandrew Sep 2, 2024
e670f0f
Merge branch 'develop' into bugfix/empty-financial-information
radulescuandrew Sep 2, 2024
776fed6
Merge pull request #632 from code4romania/bugfix/empty-financial-info…
radulescuandrew Sep 2, 2024
0b67797
feat: [contracts] expose more data to vic to be able to generate temp…
radulescuandrew Sep 3, 2024
8f5239b
Merge pull request #633 from code4romania/feat/expose-more-data-to-vic
radulescuandrew Sep 3, 2024
6d52618
fix: [438] Create organization report when the organization is created
radulescuandrew Sep 3, 2024
9976650
fix: [438] - Change adminEmail to contact person in relation with NGO
radulescuandrew Sep 3, 2024
3c6cc68
fix: [438] Throw error if data received from ANAF is missing the NGO …
radulescuandrew Sep 3, 2024
7669c3f
Merge pull request #634 from code4romania/bugfix/438
radulescuandrew Sep 3, 2024
4d6d1ec
fix: [438] change email title & body
andrei-manda Sep 3, 2024
2382eaa
fix: [438] Include financial information 'Pending' status in the orga…
radulescuandrew Sep 3, 2024
484a4ec
fix: Downloading NGOs tabel will crash the app because of inefficient…
radulescuandrew Sep 4, 2024
475a81b
fix: [438] Send financial information reminder emails and fetch anaf …
radulescuandrew Sep 4, 2024
3051e8c
fix: [438] Send "Invalid" financial information from "Refetch ANAF Da…
radulescuandrew Sep 4, 2024
1695b2d
fix: [438] Information financial in requests was crashing due to miss…
radulescuandrew Sep 4, 2024
00e3789
fix: [438] Set Financial Report as invalid only if the organization c…
radulescuandrew Sep 5, 2024
263b2b1
fix: remove sending emails to organizations during fetch ANAF data un…
radulescuandrew Oct 24, 2024
2fa09ae
Merge branch 'main' into develop
radulescuandrew Oct 24, 2024
64721e9
Production release
radulescuandrew Oct 24, 2024
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
40 changes: 40 additions & 0 deletions backend/package-lock.json

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

3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "0.0.1",
"version": "1.1.0",
"description": "",
"author": "",
"private": true,
Expand Down Expand Up @@ -44,6 +44,7 @@
"@nestjs/event-emitter": "2.0.4",
"@nestjs/passport": "10.0.3",
"@nestjs/platform-express": "10.3.10",
"@nestjs/schedule": "^4.1.0",
"@nestjs/swagger": "7.3.1",
"@nestjs/throttler": "5.2.0",
"@nestjs/typeorm": "10.0.2",
Expand Down
2 changes: 2 additions & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { PracticeProgramModule } from './modules/practice-program/practice-progr
import { CivicCenterModule } from './modules/civic-center-service/civic-center.module';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { NotificationsModule } from './modules/notifications/notifications.module';
import { ScheduleModule } from '@nestjs/schedule';

@Module({
imports: [
Expand All @@ -37,6 +38,7 @@ import { NotificationsModule } from './modules/notifications/notifications.modul
useClass: RateLimiterConfigService,
}),
EventEmitterModule.forRoot(),
ScheduleModule.forRoot(),

// Providers
DatabaseProviderModule,
Expand Down
2 changes: 1 addition & 1 deletion backend/src/common/config/email-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class EmailConfigService {
defaults: {
from: '"No Reply" <no-reply@localhost>',
},
preview: true,
preview: false,
template: {
dir: __dirname + '/../../mail/templates',
adapter: new HandlebarsAdapter({ asset_url: this.createAssetUrl }),
Expand Down
105 changes: 100 additions & 5 deletions backend/src/mail/constants/template.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export const MAIL_OPTIONS: Record<string, IMailOptions> = {
template: ORGANIZATION_REQUEST,
subject: 'NGO Hub - Solicitare creare cont organizație',
context: {
title:
'Ești doar la un pas de a primi accesul în NGO Hub.',
title: 'Ești doar la un pas de a primi accesul în NGO Hub.',
subtitle: () =>
`Solicitarea de a crea un cont pentru organizația ta în NGO Hub a fost trimisă cu succes. Echipa NGO Hub va verifica informațiile primite și imediat ce este aprobată vei primi o notificare cu detalii despre accesarea ecosistemului de soluții NGO Hub. Dacă ai întrebări, ne poți contacta la ${process.env.MAIL_CONTACT}`,
},
Expand Down Expand Up @@ -97,10 +96,106 @@ export const MAIL_OPTIONS: Record<string, IMailOptions> = {
subtitle: (organizationName, applicationName) =>
`O nouă cerere de instalare a aplicației ${applicationName} a fost creată în ONG Hub pentru organizația ${organizationName}.`,
cta: {
link: () =>
`${process.env.ONGHUB_URL}/applications/requests`,
link: () => `${process.env.ONGHUB_URL}/applications/requests`,
label: 'Vezi cererea',
},
},
},
};
REMIND_TO_UPDATE_ORGANIZATION_REPORTS: {
template: ORGANIZATION_REQUEST,
subject:
'Actualizați profilul organizației până pe 30 iunie pentru a evita suspendarea contului',
context: {
title:
'Actualizați profilul organizației până pe 30 iunie pentru a evita suspendarea contului',
subtitle: () => `
<p>Bună,</p>

<p>Ne bucurăm că ești parte din comunitatea NGO Hub!</p>

<p>Vrem să îți reamintim că este important să îți actualizezi datele din profilul tău din NGO Hub până la data de <b>30 iunie ${new Date().getFullYear()}</b>.</p>

<p>Dacă nu reușești să faci această actualizare până la termenul limită, contul tău va fi suspendat temporar.</p>

<p>Aceștia sunt pașii pe care trebuie să îi urmezi pentru actualizare:</p>

<ol>
<li>Conectează-te la contul tău NGO Hub</li>
<li>Mergi la secțiunea „Organizația mea"</li>
<li>Verifică și actualizează toate informațiile din secțiunea „Informații financiare" și „ONG-ul în numere".</li>
<li>Salvează modificările</li>
</ol>

<p>Dacă ai nevoie de ajutor sau ai orice fel de întrebare, ne poți contacta oricând la <a href="mailto:[email protected]">[email protected]</a> sau poți programa o sesiune Civic Tech 911 direct din contul NGO Hub al organizației.</p>
`,
cta: {
link: () => `${process.env.ONGHUB_URL}/organization`,
label: 'Intra in cont',
},
},
},
WEEKLY_REMINDER_TO_UPDATE_ORGANIZATION_REPORTS: {
template: ORGANIZATION_REQUEST,
subject:
'Reminder: Actualizați profilul organizației până pe 30 iunie pentru a evita suspendarea contului',
context: {
title:
'Actualizați profilul organizației până pe 30 iunie pentru a evita suspendarea contului',
subtitle: () => `
<p>Bună,</p>

<p>Ne bucurăm că ești parte din comunitatea NGO Hub!</p>

<p>Îți reamintim că termenul limită pentru actualizarea datelor din profilul tău este 30 iunie ${new Date().getFullYear()}. Pentru a-ți păstra contul activ, te rugăm să îți actualizezi informațiile cât mai curând posibil.</p>

<p>Aceștia sunt pașii pe care trebuie să îi urmezi pentru actualizare:</p>

<ol>
<li>Conectează-te la contul tău NGO Hub</li>
<li>Mergi la secțiunea „Organizația mea"</li>
<li>Verifică și actualizează toate informațiile din secțiunea „Informații financiare" și „ONG-ul în numere".</li>
<li>Salvează modificările</li>
</ol>

<p>Dacă ai nevoie de ajutor sau ai orice fel de întrebare, ne poți contacta oricând la <a href="mailto:[email protected]">[email protected]</a> sau poți programa o sesiune Civic Tech 911 direct din contul NGO Hub al organizației.</p>
`,
cta: {
link: () => `${process.env.ONGHUB_URL}/organization`,
label: 'Intra in cont',
},
},
},
NOTIFY_FOR_UNAVAILABLE_OR_INVALID_FINANCIAL_INFORMATION: {
template: ORGANIZATION_REQUEST,
subject:
'Acțiune necesară: Te rugăm să corectezi datele din profilul organizației din NGO Hub',
context: {
title:
'Acțiune necesară: Te rugăm să corectezi datele din profilul organizației din NGO Hub',
subtitle: () => `
<p>Bună,</p>

<p>Ne bucurăm că ești parte din comunitatea NGO Hub!</p>

<p>Am observat că unele dintre informațiile recent actualizate din profilul tău de pe NGO Hub par a fi invalide sau incomplete. Pentru a ne asigura că ai acces neîntrerupt la contul tău, te rugăm să îți actualizezi și corectezi datele cât mai curând posibil.</p>

<p>Aceștia sunt pașii pe care trebuie să îi urmezi pentru actualizare:</p>

<ol>
<li>Conectează-te la contul tău NGO Hub</li>
<li>Mergi la secțiunea „Organizația mea"</li>
<li>Verifică și actualizează toate informațiile din secțiunea „Informații financiare" și „ONG-ul în numere".</li>
<li>Salvează modificările</li>
</ol>

<p>Este important să faci aceste actualizări pentru a evita suspendarea contului tău NGO Hub.</p>

<p>Dacă ai nevoie de ajutor sau ai orice fel de întrebare, ne poți contacta oricând la <a href="mailto:[email protected]">[email protected]</a> sau poți programa o sesiune Civic Tech 911 direct din contul NGO Hub al organizației.</p>
`,
cta: {
link: () => `${process.env.ONGHUB_URL}/organization`,
label: 'Intra in cont',
},
},
},
};
5 changes: 4 additions & 1 deletion backend/src/mail/templates/mail-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@
{{> header}}
<div id="content">
<h1>{{title}}</h1>
<p class="p1">{{subtitle}}</p>
<p class="p1">{{{subtitle}}}</p>
{{#if cta}}
<a href={{cta.link}} target="_blank">
<button type="button">{{cta.label}}</button>
</a>
{{/if}}

<p class="p1">Cu drag, </p>
<p class="p1">Echipa NGO Hub</p>
</div>
{{> footer}}
</div>
Expand Down
33 changes: 33 additions & 0 deletions backend/src/migrations/1723119327053-ApplicationLabel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ApplicationLabel1723119327053 implements MigrationInterface {
name = 'ApplicationLabel1723119327053';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "_application-label" ("id" SERIAL NOT NULL, "deleted_on" TIMESTAMP WITH TIME ZONE, "created_on" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_on" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" text NOT NULL, CONSTRAINT "PK_c0aaf1127ad3beeaf0d3ad70096" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`CREATE INDEX "IDX_e4a4e4b1582c4e665cff9be33e" ON "_application-label" ("created_on") `,
);
await queryRunner.query(
`ALTER TABLE "application" ADD "application_label_id" integer`,
);
await queryRunner.query(
`ALTER TABLE "application" ADD CONSTRAINT "FK_318029631a770782ba1c66721fd" FOREIGN KEY ("application_label_id") REFERENCES "_application-label"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "application" DROP CONSTRAINT "FK_318029631a770782ba1c66721fd"`,
);
await queryRunner.query(
`ALTER TABLE "application" DROP COLUMN "application_label_id"`,
);
await queryRunner.query(
`DROP INDEX "public"."IDX_e4a4e4b1582c4e665cff9be33e"`,
);
await queryRunner.query(`DROP TABLE "_application-label"`);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddNewFinancialReportStatus1724056332367
implements MigrationInterface
{
name = 'AddNewFinancialReportStatus1724056332367';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE "public"."organization_financial_status_enum" AS ENUM('Not Completed', 'Pending', 'Completed', 'Invalid')`,
);
await queryRunner.query(
`ALTER TABLE "organization_financial" ADD "status" "public"."organization_financial_status_enum" NOT NULL DEFAULT 'Not Completed'`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "organization_financial" DROP COLUMN "status"`,
);
await queryRunner.query(
`DROP TYPE "public"."organization_financial_status_enum"`,
);
}
}
Loading
Loading