feat: add Auto Check MH Payment toggle with weekly schedule
Adds a toggle behind the Go button on the Payments page to automatically run the MH batch payment check on a user-selected day of week and hour. Default is off. - Schema: added autoMhCheckEnabled, autoMhCheckDayOfWeek, autoMhCheckHour to User model - Backend: new mhBatchPaymentService (shared logic), GET/PUT /auto-mh-check-setting routes, hourly cron job that fires on matching day+hour - Frontend: toggle + day select (Mon–Sun) + time select (hourly) that persist immediately to DB Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import * as z from 'zod';
|
||||
import type { Prisma } from '../../../generated/prisma';
|
||||
import { IntWithAggregatesFilterObjectSchema as IntWithAggregatesFilterObjectSchema } from './IntWithAggregatesFilter.schema';
|
||||
import { IntNullableWithAggregatesFilterObjectSchema as IntNullableWithAggregatesFilterObjectSchema } from './IntNullableWithAggregatesFilter.schema';
|
||||
import { DecimalWithAggregatesFilterObjectSchema as DecimalWithAggregatesFilterObjectSchema } from './DecimalWithAggregatesFilter.schema';
|
||||
import { DecimalNullableWithAggregatesFilterObjectSchema as DecimalNullableWithAggregatesFilterObjectSchema } from './DecimalNullableWithAggregatesFilter.schema';
|
||||
import { EnumPaymentStatusWithAggregatesFilterObjectSchema as EnumPaymentStatusWithAggregatesFilterObjectSchema } from './EnumPaymentStatusWithAggregatesFilter.schema';
|
||||
import { PaymentStatusSchema } from '../enums/PaymentStatus.schema';
|
||||
import { StringNullableWithAggregatesFilterObjectSchema as StringNullableWithAggregatesFilterObjectSchema } from './StringNullableWithAggregatesFilter.schema';
|
||||
import { Prisma } from '../../../generated/prisma';
|
||||
import Decimal from 'decimal.js';
|
||||
import { IntWithAggregatesFilterObjectSchema as IntWithAggregatesFilterObjectSchema } from './IntWithAggregatesFilter.schema';
|
||||
import { IntNullableWithAggregatesFilterObjectSchema as IntNullableWithAggregatesFilterObjectSchema } from './IntNullableWithAggregatesFilter.schema';
|
||||
import { DecimalWithAggregatesFilterObjectSchema as DecimalWithAggregatesFilterObjectSchema } from './DecimalWithAggregatesFilter.schema';
|
||||
import { DecimalNullableWithAggregatesFilterObjectSchema as DecimalNullableWithAggregatesFilterObjectSchema } from './DecimalNullableWithAggregatesFilter.schema';
|
||||
import { EnumPaymentStatusWithAggregatesFilterObjectSchema as EnumPaymentStatusWithAggregatesFilterObjectSchema } from './EnumPaymentStatusWithAggregatesFilter.schema';
|
||||
import { PaymentStatusSchema } from '../enums/PaymentStatus.schema';
|
||||
import { StringNullableWithAggregatesFilterObjectSchema as StringNullableWithAggregatesFilterObjectSchema } from './StringNullableWithAggregatesFilter.schema';
|
||||
import { DateTimeWithAggregatesFilterObjectSchema as DateTimeWithAggregatesFilterObjectSchema } from './DateTimeWithAggregatesFilter.schema'
|
||||
|
||||
import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
|
||||
|
||||
import Decimal from "decimal.js";
|
||||
const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
AND: z.union([z.lazy(() => PaymentScalarWhereWithAggregatesInputObjectSchema), z.lazy(() => PaymentScalarWhereWithAggregatesInputObjectSchema).array()]).optional(),
|
||||
OR: z.lazy(() => PaymentScalarWhereWithAggregatesInputObjectSchema).array().optional(),
|
||||
@@ -26,7 +25,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'totalBilled' must be a Decimal",
|
||||
@@ -35,7 +34,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'totalPaid' must be a Decimal",
|
||||
@@ -44,7 +43,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'totalAdjusted' must be a Decimal",
|
||||
@@ -53,7 +52,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'totalDue' must be a Decimal",
|
||||
@@ -62,7 +61,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'mhPaidAmount' must be a Decimal",
|
||||
@@ -71,7 +70,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'copayment' must be a Decimal",
|
||||
@@ -80,7 +79,7 @@ const paymentscalarwherewithaggregatesinputSchema = z.object({
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'adjustment' must be a Decimal",
|
||||
|
||||
Reference in New Issue
Block a user