/**
 * Generated by orval v8.9.1 🍺
 * Do not edit manually.
 * Api
 * EHSAN Closed Donation Loop API
 * OpenAPI spec version: 0.1.0
 */
import * as zod from 'zod';


/**
 * @summary Health check
 */
export const HealthCheckResponse = zod.object({
  "status": zod.string()
})


/**
 * @summary List all donation requests
 */
export const ListRequestsQueryParams = zod.object({
  "status": zod.coerce.string().optional(),
  "needType": zod.coerce.string().optional()
})

export const ListRequestsResponseItem = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})
export const ListRequestsResponse = zod.array(ListRequestsResponseItem)


/**
 * @summary Submit a new beneficiary request
 */
export const CreateRequestBody = zod.object({
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "description": zod.string()
})


/**
 * @summary List new (unreviewed) requests
 */
export const ListNewRequestsResponseItem = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})
export const ListNewRequestsResponse = zod.array(ListNewRequestsResponseItem)


/**
 * @summary List published donation opportunities (public)
 */
export const ListPublishedRequestsResponseItem = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})
export const ListPublishedRequestsResponse = zod.array(ListPublishedRequestsResponseItem)


/**
 * @summary Get a single request by ID
 */
export const GetRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const GetRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Verify a request (admin)
 */
export const VerifyRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const VerifyRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Publish a verified request as a donation opportunity
 */
export const PublishRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const PublishRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Simulate a donation to a published request
 */
export const DonateToRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const DonateToRequestBody = zod.object({
  "donorName": zod.string(),
  "donorPhone": zod.string(),
  "donorEmail": zod.string().nullish(),
  "amount": zod.number()
})

export const DonateToRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Mark support as delivered
 */
export const DeliverSupportParams = zod.object({
  "id": zod.coerce.string()
})

export const DeliverSupportResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Confirm beneficiary received support
 */
export const ConfirmReceiptParams = zod.object({
  "id": zod.coerce.string()
})

export const ConfirmReceiptResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Submit beneficiary thank-you message
 */
export const SubmitThankYouParams = zod.object({
  "id": zod.coerce.string()
})

export const SubmitThankYouBody = zod.object({
  "beneficiaryName": zod.string(),
  "message": zod.string()
})

export const SubmitThankYouResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Send thank-you WhatsApp to donor via OpenClaw
 */
export const SendWhatsappParams = zod.object({
  "id": zod.coerce.string()
})

export const SendWhatsappResponse = zod.object({
  "success": zod.boolean(),
  "message": zod.string(),
  "simulated": zod.boolean(),
  "sentAt": zod.string().nullish()
})


/**
 * @summary Close the case
 */
export const CloseRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const CloseRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary Reject a request
 */
export const RejectRequestParams = zod.object({
  "id": zod.coerce.string()
})

export const RejectRequestBody = zod.object({
  "reason": zod.string().optional()
})

export const RejectRequestResponse = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "beneficiaryName": zod.string(),
  "nationalId": zod.string(),
  "phone": zod.string(),
  "source": zod.enum(['beneficiary', 'charity', 'official']),
  "sourceName": zod.string(),
  "needType": zod.enum(['electricity', 'water', 'food', 'health', 'housing', 'refrigerator', 'air_conditioner', 'court_order']),
  "requestedAmount": zod.number(),
  "collectedAmount": zod.number(),
  "description": zod.string(),
  "status": zod.enum(['new', 'pending_review', 'verified', 'published', 'donated', 'delivered', 'receipt_confirmed', 'thank_you_submitted', 'whatsapp_sent', 'closed', 'rejected']),
  "currentStep": zod.number(),
  "donorId": zod.string().nullish(),
  "donorName": zod.string().nullish(),
  "thankYouMessage": zod.string().nullish(),
  "whatsappStatus": zod.union([zod.literal('pending'),zod.literal('sent'),zod.literal('failed'),zod.literal(null)]).nullish(),
  "whatsappSentAt": zod.string().nullish(),
  "rejectionReason": zod.string().nullish(),
  "createdAt": zod.string(),
  "updatedAt": zod.string()
})


/**
 * @summary List all donors
 */
export const ListDonorsResponseItem = zod.object({
  "id": zod.string(),
  "name": zod.string(),
  "phone": zod.string(),
  "email": zod.string().nullish(),
  "totalDonated": zod.number(),
  "donationCount": zod.number()
})
export const ListDonorsResponse = zod.array(ListDonorsResponseItem)


/**
 * @summary Dashboard statistics summary
 */
export const GetStatsResponse = zod.object({
  "totalRequests": zod.number(),
  "totalDonated": zod.number(),
  "totalCollected": zod.number(),
  "totalClosed": zod.number(),
  "pendingVerification": zod.number().optional(),
  "activeOpportunities": zod.number().optional(),
  "byStatus": zod.array(zod.object({
  "status": zod.string(),
  "count": zod.number()
})),
  "byNeedType": zod.array(zod.object({
  "needType": zod.string(),
  "count": zod.number(),
  "totalAmount": zod.number()
}))
})


/**
 * @summary List all WhatsApp message log entries
 */
export const ListWhatsappLogResponseItem = zod.object({
  "id": zod.string(),
  "caseId": zod.string(),
  "donorName": zod.string(),
  "donorPhone": zod.string(),
  "beneficiaryMessage": zod.string(),
  "whatsappMessage": zod.string(),
  "status": zod.enum(['pending', 'sent', 'failed']),
  "sentAt": zod.string().nullish(),
  "createdAt": zod.string()
})
export const ListWhatsappLogResponse = zod.array(ListWhatsappLogResponseItem)


