test: verify conversational birth-time rectification
This commit is contained in:
@@ -71,6 +71,7 @@ export type ConversationalRectificationServicePorts = Readonly<{
|
||||
& Partial<Pick<ConversationalRectificationStore, "importLegacy">>;
|
||||
billing: Pick<ConversationalRectificationBilling, "reserve" | "complete" | "release">;
|
||||
rectificationPriceCredits: number;
|
||||
allowNewCaseCreation?: boolean;
|
||||
loadDeclaredProfile(userId: string): Promise<ConversationalRectificationProfile>;
|
||||
loadLegacyCase?(
|
||||
userId: string,
|
||||
@@ -518,6 +519,9 @@ export function createConversationalRectificationService(
|
||||
&& current.billingState === "migration_waived") {
|
||||
throw new ConversationalRectificationError("action_conflict");
|
||||
}
|
||||
if (ports.allowNewCaseCreation === false) {
|
||||
throw new ConversationalRectificationError("service_unavailable");
|
||||
}
|
||||
|
||||
const legacy = await loadLegacy(userId, legacyCaseId);
|
||||
if (!legacy) throw new ConversationalRectificationError("case_not_found");
|
||||
@@ -690,6 +694,9 @@ export function createConversationalRectificationService(
|
||||
}
|
||||
return publicTurn(existing);
|
||||
}
|
||||
if (ports.allowNewCaseCreation === false) {
|
||||
throw new ConversationalRectificationError("service_unavailable");
|
||||
}
|
||||
|
||||
let reserved = false;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user