api doc
Some checks failed
Architecture Governance / architecture (push) Has been cancelled

This commit is contained in:
sdarbinyan
2026-07-20 01:02:36 +04:00
parent 08976de55a
commit fd5a436220
11 changed files with 930 additions and 10 deletions

View File

@@ -50,6 +50,21 @@ export interface CartPaymentRequest {
items: Array<{ itemID: number; price: number; name: string; quantity?: number; delivery?: DeliveryOption[] }>;
}
export interface CreateOrderRequest {
items: Array<{ productId: string; name: string; quantity: number; price: number }>;
customer: { name: string; email: string; phone: string };
payment?: { method: string; currency: string };
shipping?: { address: string; method: string; trackingNumber: string };
}
export interface CreateOrderResponse {
id: string;
orderNumber: string;
status: string;
total: number;
currency: string;
}
export interface QrDynamicStatusResponse {
additionalInfo: string;
paymentPurpose: string;
@@ -614,6 +629,15 @@ export class ApiService {
return this.http.post<QrCreateResponse>(`${this.baseUrl}/cart`, payload);
}
/**
* Records the just-paid cart as a backoffice order (POST /orders). Fire-and-forget
* from the caller's perspective - a failure here must never block the existing
* payment-confirmed flow, since payment itself is unaffected by this call.
*/
createOrder(payload: CreateOrderRequest): Observable<CreateOrderResponse> {
return this.http.post<CreateOrderResponse>(`${this.baseUrl}/orders`, payload);
}
checkCartPaymentStatus(qrId: string): Observable<QrDynamicStatusResponse> {
return this.http.get<QrDynamicStatusResponse>(
`${this.qrBaseUrl}/qr/dynamic/${this.cartPaymentPartnerId}/${encodeURIComponent(qrId)}`