+ {passengers.map((p, i) => {
+ const outFare = outboundSchedule?.baseFareAdult || 0;
+ const inFare = inboundSchedule?.baseFareAdult || 0;
+ const onewayFare = selectedSchedule?.baseFareAdult || 0;
+ const passengerTotal = isRoundTrip ? outFare + inFare : onewayFare;
+ return (
+
+
+
+ {p.name || `Passenger ${i + 1}`}
+
+
+ ETB {(passengerTotal / 100).toFixed(2)}
+
+
+ {isRoundTrip && (
+
+
+ Outbound
+ ETB {(outFare / 100).toFixed(2)}
+
+
+ Return
+ ETB {(inFare / 100).toFixed(2)}
+
+
+ )}
-
- Return fare
- ETB {(inboundBaseFare / 100).toFixed(2)}
-
- >
- ) : (
-
- Base fare
- ETB {(baseFare / 100).toFixed(2)}
-
- )}
+ );
+ })}
Total
ETB {(total / 100).toFixed(2)}
diff --git a/apps/edr-passenger-web/portal/src/app/booking/search/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/search/page.tsx
index a587bc87c..bb6340d0a 100644
--- a/apps/edr-passenger-web/portal/src/app/booking/search/page.tsx
+++ b/apps/edr-passenger-web/portal/src/app/booking/search/page.tsx
@@ -65,6 +65,16 @@ const searchSchema = z
message: "Return date must be after departure date",
path: ["returnDate"],
},
+ )
+ .refine(
+ (d) =>
+ !d.originStationId ||
+ !d.destinationStationId ||
+ d.originStationId !== d.destinationStationId,
+ {
+ message: "Departure and destination cannot be the same station",
+ path: ["destinationStationId"],
+ },
);
type SearchForm = z.infer;
@@ -583,7 +593,7 @@ export default function SearchPage() {
adultCount: 1,
childCount: 0,
nationality: "ETHIOPIAN",
- departureDate: new Date().toISOString().split("T")[0],
+ departureDate: "",
promoCode: "",
},
});
@@ -609,6 +619,8 @@ export default function SearchPage() {
const adults = searchParams.get("adults");
const children = searchParams.get("children");
const nat = searchParams.get("nationality");
+ const tripType = searchParams.get("tripType");
+ const returnDate = searchParams.get("returnDate");
if (o) setValue("originStationId", o);
if (d) setValue("destinationStationId", d);
if (date) setValue("departureDate", date);
@@ -616,6 +628,8 @@ export default function SearchPage() {
if (children) setValue("childCount", parseInt(children));
if (nat)
setValue("nationality", nat as "ETHIOPIAN" | "DJIBOUTIAN" | "OTHER");
+ if (tripType) setValue("tripType", tripType as "ONE_WAY" | "ROUND_TRIP");
+ if (returnDate) setValue("returnDate", returnDate);
}, [searchParams, setValue]);
useEffect(() => {
diff --git a/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx
index e088e0303..ba3fe0159 100644
--- a/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx
+++ b/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx
@@ -133,7 +133,6 @@ export default function SeatsPage() {
? outboundSchedule
: selectedSchedule;
const coachTypeId = (currentSchedule as any)?.selectedCoachTypeId;
- const coachTypeCode = (currentSchedule as any)?.selectedCoachTypeCode;
const {
data: seatMapData,
@@ -142,7 +141,7 @@ export default function SeatsPage() {
} = useQuery({
queryKey: ["seatmap", currentSchedule?.id, coachTypeId, currentJourneyType],
queryFn: async () => {
- const endpoint = `/seats/seatmap/${currentSchedule?.id}?coachTypeId=${coachTypeCode}`;
+ const endpoint = `/seats/seatmap/${currentSchedule?.id}?coachTypeId=${coachTypeId}`;
console.log("🪑 Seatmap Request:", {
endpoint,
});
diff --git a/apps/edr-payment-api/src/config/dmoney.config.ts b/apps/edr-payment-api/src/config/dmoney.config.ts
index d0938eeea..26949d301 100644
--- a/apps/edr-payment-api/src/config/dmoney.config.ts
+++ b/apps/edr-payment-api/src/config/dmoney.config.ts
@@ -11,7 +11,7 @@ export default registerAs("dmoney", () => ({
returnUrl: process.env.DMONEY_RETURN_URL ?? "",
timeoutExpress: process.env.DMONEY_TIMEOUT_EXPRESS ?? "120m",
language: process.env.DMONEY_LANGUAGE ?? "en",
- currency: process.env.DMONEY_CURRENCY ?? "FDJ",
+ currency: process.env.DMONEY_CURRENCY ?? "DJF",
privateKey: process.env.DMONEY_PRIVATE_KEY ?? "",
publicKey: process.env.DMONEY_PUBLIC_KEY ?? "",
insecureTls: process.env.DMONEY_INSECURE_TLS === "true",
diff --git a/infrastructure/docker/Dockerfile.web b/infrastructure/docker/Dockerfile.web
index 835116f9a..1ccdeb81f 100644
--- a/infrastructure/docker/Dockerfile.web
+++ b/infrastructure/docker/Dockerfile.web
@@ -28,8 +28,12 @@ FROM base AS builder
ARG TURBO_FILTER
ARG APP_PATH
ARG VITE_API_URL
+ARG VITE_BASE_API_URL
+ARG VITE_USER_MANAGEMENT_BASE
ARG NEXT_PUBLIC_API_URL
ENV VITE_API_URL=${VITE_API_URL}
+ENV VITE_BASE_API_URL=${VITE_BASE_API_URL}
+ENV VITE_USER_MANAGEMENT_BASE=${VITE_USER_MANAGEMENT_BASE}
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
COPY --from=installer /app/ .
COPY --from=pruner /app/out/full/ .
diff --git a/packages/payment-providers/src/providers/dmoney/dmoney.provider.ts b/packages/payment-providers/src/providers/dmoney/dmoney.provider.ts
index 72651b6d3..e241eec89 100644
--- a/packages/payment-providers/src/providers/dmoney/dmoney.provider.ts
+++ b/packages/payment-providers/src/providers/dmoney/dmoney.provider.ts
@@ -206,18 +206,16 @@ export class DMoneyProvider implements PaymentProvider {
appid: this.merchantAppId,
merch_code: this.merchantCode,
merch_order_id: input.merchantOrderId,
- trade_type: "Checkout" as const,
+ trade_type: "WebCheckout" as const,
+ business_type: "OnlineMerchant" as const,
title: `${input.orderRef}`,
total_amount: totalAmount,
- trans_currency: 1 == 1 ? "DJF": this.currency,
+ trans_currency: this.currency,
timeout_express: this.timeoutExpress,
...(redirectUrl ? { redirect_url: redirectUrl } : {}),
},
};
- console.log("\n\n\n")
- console.log(req)
- console.log("\n\n\n")
const sign = signRequestObject(
req as unknown as Record,
this.privateKey,
@@ -265,7 +263,7 @@ export class DMoneyProvider implements PaymentProvider {
`sign=${sign}`,
"sign_type=SHA256WithRSA",
"version=1.0",
- "trade_type=Checkout",
+ "trade_type=WebCheckout",
`language=${this.language}`,
].join("&");
return `${this.webBaseUrl}/payment/web/paygate?${query}`;
diff --git a/packages/payment-providers/src/providers/dmoney/dmoney.types.ts b/packages/payment-providers/src/providers/dmoney/dmoney.types.ts
index 72a5f2669..29729870d 100644
--- a/packages/payment-providers/src/providers/dmoney/dmoney.types.ts
+++ b/packages/payment-providers/src/providers/dmoney/dmoney.types.ts
@@ -10,12 +10,12 @@ export interface DMoneyPreOrderBizContent {
appid: string;
merch_code: string;
merch_order_id: string;
- trade_type: 'Checkout';
+ trade_type: 'WebCheckout';
+ business_type: 'OnlineMerchant';
title: string;
total_amount: string;
trans_currency: string;
timeout_express: string;
- business_type?: string;
redirect_url?: string;
callback_info?: string;
}
diff --git a/scripts/deploy/sync-env-from-server.sh b/scripts/deploy/sync-env-from-server.sh
index 802793b6e..795ab25b2 100644
--- a/scripts/deploy/sync-env-from-server.sh
+++ b/scripts/deploy/sync-env-from-server.sh
@@ -80,7 +80,7 @@ if [[ -f "${build_env}" ]]; then
set +a
if [[ -n "${GITHUB_ENV:-}" ]]; then
- grep -E '^[[:space:]]*export[[:space:]]+[A-Za-z_][A-Za-z0-9_]*=' "${build_env}" \
+ grep -E '^[[:space:]]*(export[[:space:]]+)?[A-Za-z_][A-Za-z0-9_]*=' "${build_env}" \
| sed -E 's/^[[:space:]]*export[[:space:]]+//' >> "${GITHUB_ENV}"
echo "Wrote build variables to GITHUB_ENV"
fi