From 952253dcebfc6d9b6136525a180478d3ad5cee2f Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Mon, 24 Aug 2026 21:14:08 +0700 Subject: [PATCH] Keep converted quotations immutable --- src/schemas/team.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/schemas/team.ts b/src/schemas/team.ts index b37e7bb..a19a615 100644 --- a/src/schemas/team.ts +++ b/src/schemas/team.ts @@ -1319,8 +1319,8 @@ export const teamResolvers = { updateQuotation: async (_: unknown, args: { quotationUuid: string; input: UpdateQuotationInput }, ctx: AuthContext) => { const access = assertTeamAccess(ctx) const current = await loadQuotationOrThrow(args.quotationUuid, access.teamUuid) - if (hasOwn(args.input, 'clientCurrency') && current.status === 'converted') { - throw new GraphQLError('Converted quotation currency is fixed') + if (current.status === 'converted') { + throw new GraphQLError('Converted quotation is fixed') } const teamAccess = { teamUuid: current.teamUuid, userId: access.userId } const actor = { userId: access.userId, label: actorLabel(teamAccess) } @@ -1343,6 +1343,9 @@ export const teamResolvers = { refreshQuotationTariff: async (_: unknown, args: { quotationUuid: string }, ctx: AuthContext) => { const access = assertTeamAccess(ctx) const current = await loadQuotationOrThrow(args.quotationUuid, access.teamUuid) + if (current.status === 'converted') { + throw new GraphQLError('Converted quotation is fixed') + } const teamAccess = { teamUuid: current.teamUuid, userId: access.userId } const actor = { userId: access.userId, label: actorLabel(teamAccess) } const refreshed = await refreshQuotationSelection(current.uuid, current.teamUuid, actor) @@ -1352,6 +1355,9 @@ export const teamResolvers = { selectQuotationTariff: async (_: unknown, args: { quotationUuid: string; tariffReferenceUuid: string }, ctx: AuthContext) => { const access = assertTeamAccess(ctx) const quotation = await loadQuotationOrThrow(args.quotationUuid, access.teamUuid) + if (quotation.status === 'converted') { + throw new GraphQLError('Converted quotation is fixed') + } const teamAccess = { teamUuid: quotation.teamUuid, userId: access.userId } const actor = { userId: access.userId, label: actorLabel(teamAccess) } const tariff = await loadTariffOrThrow(args.tariffReferenceUuid, quotation.teamUuid)