feat(service): P4 doc-faithfulness — SLA placeholder columns, issueSubclass, traceId on state.changed
Adds ticket.slaDueAt + ticket.issueSubclass + queue.slaPolicyRef (placeholder columns, no timer logic until P7) and propagates ticket.traceId onto ticket.state.changed events (assignment + transition). 45 tests still green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "IiosSupportQueue" ADD COLUMN "slaPolicyRef" TEXT;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "IiosTicket" ADD COLUMN "issueSubclass" TEXT,
|
||||||
|
ADD COLUMN "slaDueAt" TIMESTAMP(3);
|
||||||
@@ -414,6 +414,7 @@ model IiosSupportQueue {
|
|||||||
scope IiosScope @relation(fields: [scopeId], references: [id], onDelete: Cascade)
|
scope IiosScope @relation(fields: [scopeId], references: [id], onDelete: Cascade)
|
||||||
name String
|
name String
|
||||||
supportTier String @default("REGULAR")
|
supportTier String @default("REGULAR")
|
||||||
|
slaPolicyRef String? // SLA placeholder (no timer logic until P7)
|
||||||
assignmentPolicy Json?
|
assignmentPolicy Json?
|
||||||
enabled Boolean @default(true)
|
enabled Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
@@ -454,6 +455,8 @@ model IiosTicket {
|
|||||||
state IiosTicketState @default(NEW)
|
state IiosTicketState @default(NEW)
|
||||||
priority IiosTicketPriority @default(P3)
|
priority IiosTicketPriority @default(P3)
|
||||||
issueClass String?
|
issueClass String?
|
||||||
|
issueSubclass String?
|
||||||
|
slaDueAt DateTime? // SLA placeholder (no timer logic until P7)
|
||||||
createdFromInteractionId String?
|
createdFromInteractionId String?
|
||||||
createdFromInteraction IiosInteraction? @relation(fields: [createdFromInteractionId], references: [id])
|
createdFromInteraction IiosInteraction? @relation(fields: [createdFromInteractionId], references: [id])
|
||||||
traceId String?
|
traceId String?
|
||||||
|
|||||||
@@ -55,7 +55,12 @@ export class AssignmentService implements OnModuleInit {
|
|||||||
subject: `ticket/${ticketId}`,
|
subject: `ticket/${ticketId}`,
|
||||||
time: new Date().toISOString(),
|
time: new Date().toISOString(),
|
||||||
datacontenttype: 'application/json',
|
datacontenttype: 'application/json',
|
||||||
insignia: { scopeSnapshotId: ticket.scopeId, idempotencyKey: `assign:${ticketId}`, dataClass: 'internal' },
|
insignia: {
|
||||||
|
scopeSnapshotId: ticket.scopeId,
|
||||||
|
correlationId: ticket.traceId ?? undefined,
|
||||||
|
idempotencyKey: `assign:${ticketId}`,
|
||||||
|
dataClass: 'internal',
|
||||||
|
},
|
||||||
data: { ticketId, fromState: ticket.state, toState: 'OPEN', assignedActorId: member.actorId },
|
data: { ticketId, fromState: ticket.state, toState: 'OPEN', assignedActorId: member.actorId },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,12 @@ export class SupportService {
|
|||||||
subject: `ticket/${ticketId}`,
|
subject: `ticket/${ticketId}`,
|
||||||
time: new Date().toISOString(),
|
time: new Date().toISOString(),
|
||||||
datacontenttype: 'application/json',
|
datacontenttype: 'application/json',
|
||||||
insignia: { scopeSnapshotId: ticket.scopeId, idempotencyKey: `ticketstate:${ticketId}:${toState}`, dataClass: 'internal' },
|
insignia: {
|
||||||
|
scopeSnapshotId: ticket.scopeId,
|
||||||
|
correlationId: ticket.traceId ?? undefined,
|
||||||
|
idempotencyKey: `ticketstate:${ticketId}:${toState}`,
|
||||||
|
dataClass: 'internal',
|
||||||
|
},
|
||||||
data: { ticketId, fromState: ticket.state, toState },
|
data: { ticketId, fromState: ticket.state, toState },
|
||||||
};
|
};
|
||||||
const [updated] = await this.prisma.$transaction([
|
const [updated] = await this.prisma.$transaction([
|
||||||
|
|||||||
Reference in New Issue
Block a user