Skip to content

Commit

Permalink
feat: remove eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Dec 14, 2024
1 parent c846b35 commit ab19d2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions functions/src/cms4devfest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as functions from 'firebase-functions';
import relanceConventionSignee from './emails/template/relanceConventionSignee';
import relanceInformationsComplementaires from './emails/template/relanceInformationsComplementaires';
import relancePaiement from './emails/template/relancePaiement';
import { Company, Configuration } from './model';
import type { Company, Configuration, EmailContent, WorkflowStatus } from './model';
import { StatusEnum, onDocumentChange } from './utils/document-change';
import { sendEmail, sendEmailToAllContacts } from './utils/mail';
import { sendNewPartnerToOrganizationTeam, sendWelcomeEmail } from './v3/domain/email';
Expand All @@ -23,7 +23,7 @@ function addCreationDate(id: string) {
.catch((err) => console.log(err));
}

function updatesStatus(id: string, company: any, status: any) {
function updatesStatus(id: string, company: Company, status: WorkflowStatus) {
return firestore
.doc('companies-2025/' + id)
.update({
Expand Down Expand Up @@ -51,7 +51,7 @@ export const testEmail = functions.https.onRequest(async (req, resp) => {
resp.send(1);
});

const relance = (emailFactory: (partner: Company, configuration: Configuration) => any, partners: Company[], configuration: Configuration) => {
const relance = (emailFactory: (partner: Company, configuration: Configuration) => EmailContent, partners: Company[], configuration: Configuration) => {
partners.forEach((c: Company) => {
const emailTemplate = emailFactory(c, configuration);
sendEmailToAllContacts(c, emailTemplate, configuration);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Configuration } from '../../model';
import { Company, Configuration } from '../../model';

export default (partner: Record<string, any>, configuration: Configuration) => {
export default (partner: Company, configuration: Configuration) => {
return {
subject: `Partenariat ${configuration.gdg.event} ${configuration.convention.edition}: Relance Informations Complémentaires`,
body: `
Expand Down
2 changes: 2 additions & 0 deletions functions/src/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Timestamp } from 'firebase-admin/firestore';

export type EmailContent = { subject: string; body: string };

export type Convention = {
edition: string;
startdate: string;
Expand Down
4 changes: 2 additions & 2 deletions functions/src/utils/mail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

import { Company, Configuration, Email } from '../model';
import type { Company, Configuration, Email, EmailContent } from '../model';

export function getFrom(mail: Email): {
From: { Email: string; Name: string };
Expand All @@ -13,7 +13,7 @@ export function getFrom(mail: Email): {
};
}

export function sendEmailToAllContacts(company: Company, emailFactory: { subject: string; body: string }, configuration: Configuration) {
export function sendEmailToAllContacts(company: Company, emailFactory: EmailContent, configuration: Configuration) {
if (!configuration.mail.enabled) {
return;
}
Expand Down

0 comments on commit ab19d2a

Please sign in to comment.