feat(subscription): separate selection from payment and add issue feedback
Docker Image / Build and Push Docker Image (push) Successful in 2m2s
Docker Image / Build and Push Docker Image (push) Successful in 2m2s
(cherry picked from commit fe9d31146b)
This commit is contained in:
@@ -12,6 +12,14 @@ export interface FeedbackContext {
|
||||
platform: string;
|
||||
browser: string;
|
||||
viewport: string;
|
||||
sourcePage?: string;
|
||||
paymentIssueReason?: string;
|
||||
subscriptionType?: string;
|
||||
planId?: string;
|
||||
orderId?: string;
|
||||
payChannel?: string;
|
||||
countryCode?: string;
|
||||
characterId?: string;
|
||||
}
|
||||
|
||||
export interface SubmitFeedbackInput {
|
||||
@@ -19,4 +27,5 @@ export interface SubmitFeedbackInput {
|
||||
content: string;
|
||||
context: FeedbackContext;
|
||||
images: readonly File[];
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
@@ -32,12 +32,17 @@ describe("FeedbackApi", () => {
|
||||
viewport: "392x760@2.75",
|
||||
},
|
||||
images: [image],
|
||||
idempotencyKey: "payment_feedback_123",
|
||||
});
|
||||
|
||||
expect(response).toEqual({ feedbackId: "feedback-123" });
|
||||
expect(httpClientMock).toHaveBeenCalledWith(
|
||||
"/api/feedback",
|
||||
expect.objectContaining({ method: "POST", body: expect.any(FormData) }),
|
||||
expect.objectContaining({
|
||||
method: "POST",
|
||||
body: expect.any(FormData),
|
||||
headers: { "Idempotency-Key": "payment_feedback_123" },
|
||||
}),
|
||||
);
|
||||
const body = httpClientMock.mock.calls[0][1].body as FormData;
|
||||
expect(body.get("category")).toBe("problem");
|
||||
|
||||
@@ -19,6 +19,9 @@ export class FeedbackApi {
|
||||
const envelope = await httpClient<ApiEnvelope<unknown>>(ApiPath.feedback, {
|
||||
method: "POST",
|
||||
body,
|
||||
...(input.idempotencyKey
|
||||
? { headers: { "Idempotency-Key": input.idempotencyKey } }
|
||||
: {}),
|
||||
});
|
||||
return FeedbackSubmitResponseSchema.parse(unwrap(envelope));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user