summaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/schemas/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/schemas/index.ts')
-rw-r--r--packages/merchant-backoffice-ui/src/schemas/index.ts24
1 files changed, 2 insertions, 22 deletions
diff --git a/packages/merchant-backoffice-ui/src/schemas/index.ts b/packages/merchant-backoffice-ui/src/schemas/index.ts
index 5bcb68021..43384299b 100644
--- a/packages/merchant-backoffice-ui/src/schemas/index.ts
+++ b/packages/merchant-backoffice-ui/src/schemas/index.ts
@@ -1,6 +1,6 @@
/*
This file is part of GNU Taler
- (C) 2021-2023 Taler Systems S.A.
+ (C) 2021-2024 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -19,6 +19,7 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
+import { Amounts } from "@gnu-taler/taler-util";
import { isAfter, isFuture } from "date-fns";
import * as yup from "yup";
import { PAYTO_REGEX } from "../utils/constants.js";
@@ -126,27 +127,6 @@ export const InstanceSchema = yup.object().shape({
export const InstanceUpdateSchema = InstanceSchema.clone().omit(["id"]);
export const InstanceCreateSchema = InstanceSchema.clone();
-export const AuthorizeRewardSchema = yup.object().shape({
- justification: yup.string().required(),
- amount: yup
- .string()
- .required()
- .test("amount", "the amount is not valid", currencyWithAmountIsValid)
- .test("amount_positive", "the amount is not valid", currencyGreaterThan0),
- next_url: yup.string().required(),
-});
-
-const stringIsValidJSON = (value?: string) => {
- const p = value?.trim();
- if (!p) return true;
- try {
- JSON.parse(p);
- return true;
- } catch {
- return false;
- }
-};
-
export const OrderCreateSchema = yup.object().shape({
pricing: yup
.object()