feat: add Copayment and Adjustment columns to payments table
- Added copayment and adjustment fields (Decimal, default 0) to Payment model in schema and directly to DB via ALTER TABLE - Added PATCH /api/payments/:id/copayment and /adjustment routes - Added inline-editable Copayment and Adjustment columns after MH Paid with same click-to-edit format; Copayment in blue, Adjustment in orange Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,33 @@ const makeSchema = () => z.object({
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'totalDue' must be a Decimal",
|
||||
}),
|
||||
mhPaidAmount: z.union([
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'mhPaidAmount' must be a Decimal",
|
||||
}).optional().nullable(),
|
||||
copayment: z.union([
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'copayment' must be a Decimal",
|
||||
}).optional(),
|
||||
adjustment: z.union([
|
||||
z.number(),
|
||||
z.string(),
|
||||
z.instanceof(Decimal),
|
||||
z.instanceof(Prisma.Decimal),
|
||||
DecimalJSLikeSchema,
|
||||
]).refine((v) => isValidDecimalInput(v), {
|
||||
message: "Field 'adjustment' must be a Decimal",
|
||||
}).optional(),
|
||||
status: PaymentStatusSchema.optional(),
|
||||
notes: z.string().optional().nullable(),
|
||||
icn: z.string().optional().nullable(),
|
||||
|
||||
Reference in New Issue
Block a user