Files
medusa-store/packages/medusa/src/api/admin/refund-reasons/validators.ts
T
William Bouchard 087887fefb feat(core-flows): support ad hoc returns (#13598)
* feat(core-flows): support ad hoc returns

* fix: missing transform

* handle edge case

* refactor

* replace gte for gt

* cleanup

* weird bug fix

* add test

* Create quick-nails-kick.md

* stop sending empty strings

* add code to refund reason

* fix build

* fix tests

* handle code in dashboard

* fix tests

* more tests failing

* add reference and reference id to credit lieng

* rework create refund form
2025-09-30 07:38:50 -04:00

44 lines
1.2 KiB
TypeScript

import { z } from "zod"
import { createFindParams, createOperatorMap } from "../../utils/validators"
export type AdminCreatePaymentRefundReasonType = z.infer<
typeof AdminCreatePaymentRefundReason
>
export const AdminCreatePaymentRefundReason = z
.object({
label: z.string(),
code: z.string(),
description: z.string().nullish(),
})
.strict()
export type AdminUpdatePaymentRefundReasonType = z.infer<
typeof AdminUpdatePaymentRefundReason
>
export const AdminUpdatePaymentRefundReason = z
.object({
label: z.string().optional(),
code: z.string().optional(),
description: z.string().nullish(),
})
.strict()
/**
* Parameters used to filter and configure the pagination of the retrieved refund reason.
*/
export const AdminGetRefundReasonsParams = createFindParams({
limit: 15,
offset: 0,
}).merge(
z.object({
id: z.union([z.string(), z.array(z.string())]).optional(),
q: z.string().optional(),
created_at: createOperatorMap().optional(),
updated_at: createOperatorMap().optional(),
deleted_at: createOperatorMap().optional(),
})
)
export type AdminGetRefundReasonsParamsType = z.infer<
typeof AdminGetRefundReasonsParams
>