Some checks failed
CD Preprod / Unit Tests (${{ matrix.app }}) (backend) (push) Blocked by required conditions
CD Preprod / Unit Tests (${{ matrix.app }}) (frontend) (push) Blocked by required conditions
CD Preprod / Integration Tests (push) Blocked by required conditions
CD Preprod / Build & Push Backend (push) Blocked by required conditions
CD Preprod / Build & Push Frontend (push) Blocked by required conditions
CD Preprod / Deploy to Preprod (push) Blocked by required conditions
CD Preprod / Smoke Tests (push) Blocked by required conditions
CD Preprod / Deployment Summary (push) Blocked by required conditions
CD Preprod / Notify Success (push) Blocked by required conditions
CD Preprod / Notify Failure (push) Blocked by required conditions
CD Preprod / Quality (${{ matrix.app }}) (backend) (push) Has been cancelled
CD Preprod / Quality (${{ matrix.app }}) (frontend) (push) Has been cancelled
Aligns preprod with the complete application codebase (cicd branch). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
163 lines
3.5 KiB
TypeScript
163 lines
3.5 KiB
TypeScript
/**
|
|
* Email Port
|
|
*
|
|
* Defines the interface for email sending operations.
|
|
* This is a secondary port (output port) in hexagonal architecture.
|
|
*/
|
|
|
|
export const EMAIL_PORT = 'EmailPort';
|
|
|
|
export interface EmailAttachment {
|
|
filename: string;
|
|
content: Buffer | string;
|
|
contentType?: string;
|
|
}
|
|
|
|
export interface EmailOptions {
|
|
to: string | string[];
|
|
from?: string;
|
|
cc?: string | string[];
|
|
bcc?: string | string[];
|
|
replyTo?: string;
|
|
subject: string;
|
|
html?: string;
|
|
text?: string;
|
|
attachments?: EmailAttachment[];
|
|
}
|
|
|
|
export interface EmailPort {
|
|
/**
|
|
* Send an email
|
|
*/
|
|
send(options: EmailOptions): Promise<void>;
|
|
|
|
/**
|
|
* Send booking confirmation email
|
|
*/
|
|
sendBookingConfirmation(
|
|
email: string,
|
|
bookingNumber: string,
|
|
bookingDetails: any,
|
|
pdfAttachment?: Buffer
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send email verification email
|
|
*/
|
|
sendVerificationEmail(email: string, token: string): Promise<void>;
|
|
|
|
/**
|
|
* Send password reset email
|
|
*/
|
|
sendPasswordResetEmail(email: string, token: string): Promise<void>;
|
|
|
|
/**
|
|
* Send welcome email
|
|
*/
|
|
sendWelcomeEmail(email: string, firstName: string): Promise<void>;
|
|
|
|
/**
|
|
* Send user invitation email (legacy - with temp password)
|
|
*/
|
|
sendUserInvitation(
|
|
email: string,
|
|
organizationName: string,
|
|
inviterName: string,
|
|
tempPassword: string
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send invitation email with registration link (token-based)
|
|
*/
|
|
sendInvitationWithToken(
|
|
email: string,
|
|
firstName: string,
|
|
lastName: string,
|
|
organizationName: string,
|
|
inviterName: string,
|
|
invitationLink: string,
|
|
expiresAt: Date
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send CSV booking request email to carrier
|
|
*/
|
|
sendCsvBookingRequest(
|
|
carrierEmail: string,
|
|
bookingDetails: {
|
|
bookingId: string;
|
|
bookingNumber?: string;
|
|
documentPassword?: string;
|
|
origin: string;
|
|
destination: string;
|
|
volumeCBM: number;
|
|
weightKG: number;
|
|
palletCount: number;
|
|
priceUSD: number;
|
|
priceEUR: number;
|
|
primaryCurrency: string;
|
|
transitDays: number;
|
|
containerType: string;
|
|
documents: Array<{
|
|
type: string;
|
|
fileName: string;
|
|
}>;
|
|
confirmationToken: string;
|
|
notes?: string;
|
|
}
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send carrier account creation email with temporary password
|
|
*/
|
|
sendCarrierAccountCreated(
|
|
email: string,
|
|
carrierName: string,
|
|
temporaryPassword: string
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send carrier password reset email with temporary password
|
|
*/
|
|
sendCarrierPasswordReset(
|
|
email: string,
|
|
carrierName: string,
|
|
temporaryPassword: string
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send document access email to carrier after booking acceptance
|
|
*/
|
|
sendDocumentAccessEmail(
|
|
carrierEmail: string,
|
|
data: {
|
|
carrierName: string;
|
|
bookingId: string;
|
|
bookingNumber?: string;
|
|
documentPassword?: string;
|
|
origin: string;
|
|
destination: string;
|
|
volumeCBM: number;
|
|
weightKG: number;
|
|
documentCount: number;
|
|
confirmationToken: string;
|
|
}
|
|
): Promise<void>;
|
|
|
|
/**
|
|
* Send notification to carrier when new documents are added
|
|
*/
|
|
sendNewDocumentsNotification(
|
|
carrierEmail: string,
|
|
data: {
|
|
carrierName: string;
|
|
bookingId: string;
|
|
origin: string;
|
|
destination: string;
|
|
newDocumentsCount: number;
|
|
totalDocumentsCount: number;
|
|
confirmationToken: string;
|
|
}
|
|
): Promise<void>;
|
|
}
|