aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/schemas/index.ts
diff options
context:
space:
mode:
authorChristian Blättler <blatc2@bfh.ch>2024-05-01 08:00:06 +0200
committerChristian Blättler <blatc2@bfh.ch>2024-05-01 08:00:06 +0200
commit8d1ce9dae1fd94204c142ac599b498bec9680b6c (patch)
treefc6a55104ca6a457d67336db5757ec442824e074 /packages/merchant-backoffice-ui/src/schemas/index.ts
parent09046010252b134348de8b18c0c99ffea4e3c95d (diff)
parent20d2861508df18da18e66c94a5a268067565121b (diff)
downloadwallet-core-8d1ce9dae1fd94204c142ac599b498bec9680b6c.tar.xz
Merge branch 'master' into feature/tokens
# Conflicts: # packages/auditor-backoffice-ui/src/InstanceRoutes.tsx # packages/merchant-backoffice-ui/src/declaration.d.ts # packages/merchant-backoffice-ui/src/schemas/index.ts
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()