mirror of
https://github.com/spliit-app/spliit.git
synced 2025-12-06 09:29:39 +01:00
Reimbursements
This commit is contained in:
@@ -53,6 +53,7 @@ export async function createExpense(
|
||||
})),
|
||||
},
|
||||
},
|
||||
isReimbursement: expenseFormValues.isReimbursement,
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -105,6 +106,7 @@ export async function updateExpense(
|
||||
),
|
||||
),
|
||||
},
|
||||
isReimbursement: expenseFormValues.isReimbursement,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ export function getSuggestedReimbursements(
|
||||
([participantId, { total }]) => ({ participantId, total }),
|
||||
)
|
||||
balancesArray.sort((b1, b2) => b2.total - b1.total)
|
||||
console.log(balancesArray)
|
||||
const reimbursements: Reimbursement[] = []
|
||||
while (balancesArray.length > 1) {
|
||||
const first = balancesArray[0]
|
||||
|
||||
@@ -49,6 +49,7 @@ export const expenseFormSchema = z.object({
|
||||
paidFor: z
|
||||
.array(z.string())
|
||||
.min(1, 'The expense must be paid for at least 1 participant.'),
|
||||
isReimbursement: z.boolean(),
|
||||
})
|
||||
|
||||
export type ExpenseFormValues = z.infer<typeof expenseFormSchema>
|
||||
|
||||
Reference in New Issue
Block a user