fix: keep deal edits and right-align club leaderboard

Empty product lists were wiping the manual amount on update, and follow-ups were only created for new deals. Leaderboard rows were laid out left-to-right on an RTL page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 11:38:59 +03:30
co-authored by Cursor
parent 6b4bd0b03e
commit 0e420a443f
3 changed files with 27 additions and 14 deletions
+4 -3
View File
@@ -225,14 +225,15 @@ export class DealsService {
}
const data: Prisma.DealUncheckedUpdateInput = {};
const pricedFromLines = (dto.lineItems?.length ?? 0) > 0;
if (dto.title !== undefined) data.title = dto.title.trim();
if ('amount' in dto && dto.lineItems === undefined) {
if ('amount' in dto && !pricedFromLines) {
data.amount =
dto.amount == null || Number.isNaN(Number(dto.amount))
? null
: new Prisma.Decimal(dto.amount);
}
if (dto.currency !== undefined && dto.lineItems === undefined) {
if (dto.currency !== undefined && !pricedFromLines) {
data.currency = dto.currency.trim() || 'IRR';
}
if ('source' in dto) data.source = emptyToNull(dto.source);
@@ -270,7 +271,7 @@ export class DealsService {
assigneeConnect = assigneeIds.map((uid) => ({ id: uid }));
}
if (dto.lineItems !== undefined) {
if (pricedFromLines && dto.lineItems) {
const total = sumLineItems(dto.lineItems);
data.amount =
total == null ? null : new Prisma.Decimal(total);