add whatsapp contact button and prepayment/full payment badge
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { api } from './client';
|
||||
import { backendDateToFrontend } from '../utils/date';
|
||||
import type { Delivery, DeliveryRequestSource, PickupLocation, DeliveryStatus } from '../types';
|
||||
import type { Delivery, DeliveryRequestSource, PickupLocation, DeliveryStatus, PaymentStatus } from '../types';
|
||||
|
||||
// Types matching backend responses
|
||||
export interface BackendDelivery {
|
||||
@@ -22,6 +22,7 @@ export interface BackendDelivery {
|
||||
phone: string;
|
||||
additional_phone: string | null;
|
||||
has_elevator: boolean;
|
||||
payment_status: PaymentStatus;
|
||||
service_info: string | null;
|
||||
comment: string;
|
||||
status: DeliveryStatus;
|
||||
@@ -77,6 +78,7 @@ export function mapBackendToFrontend(backend: BackendDelivery): Delivery {
|
||||
phone: backend.phone,
|
||||
additionalPhone: backend.additional_phone || undefined,
|
||||
hasElevator: backend.has_elevator,
|
||||
paymentStatus: backend.payment_status || 'prepaid',
|
||||
serviceInfo: backend.service_info || undefined,
|
||||
comment: backend.comment,
|
||||
status: backend.status,
|
||||
@@ -133,6 +135,7 @@ export const deliveriesApi = {
|
||||
phone: data.phone,
|
||||
additional_phone: data.additionalPhone || null,
|
||||
has_elevator: data.hasElevator,
|
||||
payment_status: data.paymentStatus,
|
||||
service_info: data.serviceInfo || null,
|
||||
comment: data.comment,
|
||||
};
|
||||
@@ -163,6 +166,7 @@ export const deliveriesApi = {
|
||||
phone: data.phone,
|
||||
additional_phone: data.additionalPhone || null,
|
||||
has_elevator: data.hasElevator,
|
||||
payment_status: data.paymentStatus,
|
||||
service_info: data.serviceInfo || null,
|
||||
comment: data.comment,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user