🔄 cleanup: order with 3 key relations, and ckflow now upto speeded
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { get } from "svelte/store";
|
||||
import { CheckoutStep } from "../../data/entities/index";
|
||||
import { trpcApiStore } from "$lib/stores/api";
|
||||
import { toast } from "svelte-sonner";
|
||||
import { flightTicketStore } from "../../data/store";
|
||||
import { ckFlowVM } from "$lib/domains/ckflow/view/ckflow.vm.svelte";
|
||||
import { newOrderModel } from "$lib/domains/order/data/entities";
|
||||
import { passengerInfoVM } from "$lib/domains/passengerinfo/view/passenger.info.vm.svelte";
|
||||
import { paymentInfoVM } from "./payment-info-section/payment.info.vm.svelte";
|
||||
import {
|
||||
paymentDetailsPayloadModel,
|
||||
PaymentMethod,
|
||||
} from "$lib/domains/paymentinfo/data/entities";
|
||||
import { trpcApiStore } from "$lib/stores/api";
|
||||
import { toast } from "svelte-sonner";
|
||||
import { get } from "svelte/store";
|
||||
import { CheckoutStep } from "../../data/entities/index";
|
||||
import { flightTicketStore } from "../../data/store";
|
||||
import { paymentInfoVM } from "./payment-info-section/payment.info.vm.svelte";
|
||||
import { calculateTicketPrices } from "./total.calculator";
|
||||
import { ckFlowVM } from "$lib/domains/ckflow/view/ckflow.vm.svelte";
|
||||
|
||||
class TicketCheckoutViewModel {
|
||||
checkoutStep = $state(CheckoutStep.Initial);
|
||||
@@ -93,7 +93,7 @@ class TicketCheckoutViewModel {
|
||||
fullfilledPrice: validatedPrices.finalTotal, // Same as displayPrice
|
||||
pricePerPassenger: validatedPrices.pricePerPassenger,
|
||||
flightTicketInfoId: -1,
|
||||
paymentDetailsId: -1,
|
||||
paymentInfoId: -1,
|
||||
});
|
||||
|
||||
if (parsed.error) {
|
||||
@@ -126,7 +126,7 @@ class TicketCheckoutViewModel {
|
||||
flightTicketId: ticket.id,
|
||||
orderModel: parsed.data,
|
||||
passengerInfos: passengerInfoVM.passengerInfos,
|
||||
paymentDetails: pInfoParsed.data,
|
||||
paymentInfo: pInfoParsed.data,
|
||||
refOIds: ticket.refOIds,
|
||||
flowId: ckFlowVM.flowId,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user