update mongoose to 5.8.3 (lots of types changes)

This commit is contained in:
Thomas Ruoff
2024-09-10 22:44:25 +02:00
parent 3ecbd16a2c
commit 32818b7492
22 changed files with 136 additions and 251 deletions

View File

@@ -1,5 +1,5 @@
import { MILAGE_TARIFS } from '../db/enums'
import { AdditionalCost, Bill } from '../db/bill'
import { IAdditionalCost, IBill } from '../db/bill'
import fetch from './fetch'
function roundToCent(amount: number): number {
@@ -61,7 +61,7 @@ export function getBillTotal({
}: {
tarif: MILAGE_TARIFS
milage?: number
additionalCosts: AdditionalCost[]
additionalCosts: IAdditionalCost[]
}): number {
const milageCosts = getMilageCosts({ tarif, km: milage })
const additionalCostsSum = additionalCosts
@@ -73,8 +73,8 @@ export function getBillTotal({
export async function createBill(
bookingUuid: string,
bill: Bill
): Promise<Bill> {
bill: IBill
): Promise<IBill> {
return fetch(`/api/bookings/${bookingUuid}/bill`, {
method: 'POST',
body: bill,
@@ -83,8 +83,8 @@ export async function createBill(
export async function patchBill(
bookingUuid: string,
bill: Bill
): Promise<Bill> {
bill: IBill
): Promise<IBill> {
return fetch(`/api/bookings/${bookingUuid}/bill`, {
method: 'POST',
body: bill,