feat: add provider column, commission tracking, and report provider filter
- Claims & Payments: save npiProviderId when submitting MH claim; sync between claim and payment on update - Claims table: add Provider column showing rendering provider name - Payments table: add Provider column + purple Commissioned badge on status - Claim edit modal: add Rendering Provider dropdown (defaults to Mary Scannell) - Payment edit modal: add Rendering Provider dropdown + Commissioned metadata display - Reports page: add Provider filter dropdown (dynamic from NPI providers settings) - Reports page: remove Collections by Doctor report type and Select Doctor dropdown - Commission section: new section in reports page with date range + provider filter, shows eligible paid claims/payments per provider, multi-select checkboxes, Pay Commission modal with print + save, marks payments as commissioned so they are excluded from future cycles - DB: add CommissionBatch and CommissionBatchItem tables; backfill Payment.npiProviderId from linked claims - Backend: PATCH /api/payments/:id/provider syncs to linked claim; PUT /api/claims/:id syncs to linked payment; new /api/commissions routes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import * as z from 'zod';
|
||||
// prettier-ignore
|
||||
export const CommissionBatchInputSchema = z.object({
|
||||
id: z.number().int(),
|
||||
npiProviderId: z.number().int(),
|
||||
totalCollection: z.number(),
|
||||
commissionAmount: z.number(),
|
||||
notes: z.string().optional().nullable(),
|
||||
createdAt: z.date(),
|
||||
npiProvider: z.unknown(),
|
||||
items: z.array(z.unknown())
|
||||
}).strict();
|
||||
|
||||
export type CommissionBatchInputType = z.infer<typeof CommissionBatchInputSchema>;
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as z from 'zod';
|
||||
// prettier-ignore
|
||||
export const CommissionBatchItemInputSchema = z.object({
|
||||
id: z.number().int(),
|
||||
commissionBatchId: z.number().int(),
|
||||
paymentId: z.number().int(),
|
||||
collectionAmount: z.number(),
|
||||
commissionBatch: z.unknown(),
|
||||
payment: z.unknown()
|
||||
}).strict();
|
||||
|
||||
export type CommissionBatchItemInputType = z.infer<typeof CommissionBatchItemInputSchema>;
|
||||
@@ -8,6 +8,8 @@ export const NpiProviderInputSchema = z.object({
|
||||
createdAt: z.date(),
|
||||
user: z.unknown(),
|
||||
claims: z.array(z.unknown()),
|
||||
payments: z.array(z.unknown()),
|
||||
commissionBatches: z.array(z.unknown()),
|
||||
appointmentProcedures: z.array(z.unknown())
|
||||
}).strict();
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ export const PaymentInputSchema = z.object({
|
||||
patientId: z.number().int(),
|
||||
userId: z.number().int(),
|
||||
updatedById: z.number().int().optional().nullable(),
|
||||
npiProviderId: z.number().int().optional().nullable(),
|
||||
totalBilled: z.number(),
|
||||
totalPaid: z.number(),
|
||||
totalAdjusted: z.number(),
|
||||
@@ -22,8 +23,10 @@ export const PaymentInputSchema = z.object({
|
||||
claim: z.unknown().optional().nullable(),
|
||||
patient: z.unknown(),
|
||||
updatedBy: z.unknown().optional().nullable(),
|
||||
npiProvider: z.unknown().optional().nullable(),
|
||||
serviceLineTransactions: z.array(z.unknown()),
|
||||
serviceLines: z.array(z.unknown())
|
||||
serviceLines: z.array(z.unknown()),
|
||||
commissionBatchItems: z.array(z.unknown())
|
||||
}).strict();
|
||||
|
||||
export type PaymentInputType = z.infer<typeof PaymentInputSchema>;
|
||||
|
||||
@@ -34,3 +34,5 @@ export { OfficeContactInputSchema } from './OfficeContact.input';
|
||||
export { InsuranceContactInputSchema } from './InsuranceContact.input';
|
||||
export { ProcedureTimeslotInputSchema } from './ProcedureTimeslot.input';
|
||||
export { PatientConversationInputSchema } from './PatientConversation.input';
|
||||
export { CommissionBatchInputSchema } from './CommissionBatch.input';
|
||||
export { CommissionBatchItemInputSchema } from './CommissionBatchItem.input';
|
||||
|
||||
Reference in New Issue
Block a user