@timardex/cluemart-shared 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +40 -4
- package/dist/index.d.mts +19 -28
- package/dist/index.d.ts +19 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -320,6 +320,14 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
320
320
|
var dateTimeSchema = yup.object().shape({
|
|
321
321
|
endDate: yup.string().concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
322
322
|
endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
323
|
+
marketPrice: yup.number().typeError("Market price must be a number").min(0.1, "Market price must be at least 0.1").required("Market price is required").test(
|
|
324
|
+
"no-leading-zeros",
|
|
325
|
+
"Market price must not have leading zeros",
|
|
326
|
+
(value, context) => {
|
|
327
|
+
const original = context.originalValue?.toString() ?? "";
|
|
328
|
+
return !/^0\d+(\.\d+)?$/.test(original);
|
|
329
|
+
}
|
|
330
|
+
),
|
|
323
331
|
startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
|
|
324
332
|
startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
325
333
|
});
|
|
@@ -358,9 +366,23 @@ var marketSchema = globalResourceSchema.shape({
|
|
|
358
366
|
location: locationSchema,
|
|
359
367
|
provider: yup2.string().trim().min(3).required("Provider is required"),
|
|
360
368
|
stallApplicationInfo: yup2.object().shape({
|
|
361
|
-
applicationDeadlineHours: yup2.number().min(1).required("Application deadline hours is required")
|
|
369
|
+
applicationDeadlineHours: yup2.number().typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test(
|
|
370
|
+
"no-leading-zeros",
|
|
371
|
+
"Application deadline hours must not start with leading zeros",
|
|
372
|
+
(value, context) => {
|
|
373
|
+
const original = context.originalValue?.toString() ?? "";
|
|
374
|
+
return !/^0\d+$/.test(original);
|
|
375
|
+
}
|
|
376
|
+
),
|
|
362
377
|
rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
|
|
363
|
-
stallCapacity: yup2.number().min(1).required("Stall capacity is required")
|
|
378
|
+
stallCapacity: yup2.number().typeError("Stall capacity must be a number").min(1, "Stall capacity must be at least 1").integer("Stall capacity must be a whole number").required("Stall capacity is required").test(
|
|
379
|
+
"no-leading-zeros",
|
|
380
|
+
"Stall capacity must not have leading zeros",
|
|
381
|
+
(value, context) => {
|
|
382
|
+
const original = context.originalValue?.toString() ?? "";
|
|
383
|
+
return !/^0\d+$/.test(original);
|
|
384
|
+
}
|
|
385
|
+
)
|
|
364
386
|
}),
|
|
365
387
|
tags: yup2.array().of(yup2.string().defined()).nullable()
|
|
366
388
|
});
|
|
@@ -494,12 +516,14 @@ var defaultMarketFormValues = {
|
|
|
494
516
|
{
|
|
495
517
|
endDate: "04-05-2025",
|
|
496
518
|
endTime: "15:00",
|
|
519
|
+
marketPrice: 0,
|
|
497
520
|
startDate: "04-05-2025",
|
|
498
521
|
startTime: "09:00"
|
|
499
522
|
},
|
|
500
523
|
{
|
|
501
524
|
endDate: "05-05-2025",
|
|
502
525
|
endTime: "15:00",
|
|
526
|
+
marketPrice: 0,
|
|
503
527
|
startDate: "05-05-2025",
|
|
504
528
|
startTime: "09:00"
|
|
505
529
|
}
|
|
@@ -518,9 +542,9 @@ var defaultMarketFormValues = {
|
|
|
518
542
|
},
|
|
519
543
|
provider: "Provider name",
|
|
520
544
|
stallApplicationInfo: {
|
|
521
|
-
applicationDeadlineHours:
|
|
545
|
+
applicationDeadlineHours: 0,
|
|
522
546
|
rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
|
|
523
|
-
stallCapacity:
|
|
547
|
+
stallCapacity: 0
|
|
524
548
|
},
|
|
525
549
|
tags: null
|
|
526
550
|
};
|
|
@@ -1395,6 +1419,7 @@ var MARKET_DATETIME_FIELDS_FRAGMENT = gql5`
|
|
|
1395
1419
|
fragment MarketDateTimeFields on MarketDateTimeType {
|
|
1396
1420
|
endDate
|
|
1397
1421
|
endTime
|
|
1422
|
+
marketPrice
|
|
1398
1423
|
startDate
|
|
1399
1424
|
startTime
|
|
1400
1425
|
}
|
|
@@ -1818,6 +1843,7 @@ var RELATION_LOGS_FRAGMENT = gql9`
|
|
|
1818
1843
|
var RELATION_DATES_FRAGMENT = gql9`
|
|
1819
1844
|
fragment RelationDates on RelationDateType {
|
|
1820
1845
|
lastUpdateBy
|
|
1846
|
+
marketPrice
|
|
1821
1847
|
startDate
|
|
1822
1848
|
status
|
|
1823
1849
|
}
|
|
@@ -2749,6 +2775,14 @@ var marketStartDateFields = [
|
|
|
2749
2775
|
placeholder: "Start Time"
|
|
2750
2776
|
}
|
|
2751
2777
|
];
|
|
2778
|
+
var marketPriceByDateFields = [
|
|
2779
|
+
{
|
|
2780
|
+
helperText: "Market Price for this date *",
|
|
2781
|
+
keyboardType: "number-pad",
|
|
2782
|
+
name: "marketPrice",
|
|
2783
|
+
placeholder: "Market Price"
|
|
2784
|
+
}
|
|
2785
|
+
];
|
|
2752
2786
|
var marketEndDateFields = [
|
|
2753
2787
|
{
|
|
2754
2788
|
dateMode: "date",
|
|
@@ -3246,6 +3280,7 @@ export {
|
|
|
3246
3280
|
mapArrayToOptions,
|
|
3247
3281
|
marketBasicInfoFields,
|
|
3248
3282
|
marketEndDateFields,
|
|
3283
|
+
marketPriceByDateFields,
|
|
3249
3284
|
marketSchema,
|
|
3250
3285
|
marketStartDateFields,
|
|
3251
3286
|
packagingOptions,
|