feat(F-153): completed feature
This commit is contained in:
@@ -262,11 +262,8 @@ export async function registerOrdersRoutes(
|
||||
let notified = false;
|
||||
let notificationError = '';
|
||||
try {
|
||||
const emailRow = await deps.pool.query<{ email: string }>(
|
||||
'SELECT email FROM identity_users WHERE id = $1',
|
||||
[order.userId],
|
||||
);
|
||||
const to = emailRow.rows[0]?.email;
|
||||
// F-153: email is now associated on the order view via a repository join.
|
||||
const to = order.email;
|
||||
if (to) {
|
||||
await sendOrderStatusEmail(deps.pool, {
|
||||
to,
|
||||
@@ -504,6 +501,7 @@ function serializeOrder(order: {
|
||||
updatedAt: Date;
|
||||
idempotencyKey: string | null;
|
||||
userId?: string;
|
||||
email?: string | null;
|
||||
items: Array<{
|
||||
id: string;
|
||||
productId: string;
|
||||
@@ -521,6 +519,7 @@ function serializeOrder(order: {
|
||||
return {
|
||||
id: order.id,
|
||||
userId: order.userId,
|
||||
email: order.email ?? null,
|
||||
state: order.state,
|
||||
currency: order.currency,
|
||||
subtotalCents: order.subtotalCents,
|
||||
|
||||
Reference in New Issue
Block a user