mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
UAT fixes and enhancements
This commit is contained in:
@@ -190,7 +190,10 @@ function BookingsPageContent() {
|
||||
render: (booking: any) => {
|
||||
const isRoundTrip = booking?.bookingType === 'ROUND_TRIP' || booking?.bookingType === 'ROUND_TRIP_TRANSIT';
|
||||
const returnDeparture = booking?.returnSchedule?.departureAt;
|
||||
console.log(JSON.stringify(booking.packageId));
|
||||
const hasActualStops = booking.schedule?.originStation && booking.schedule?.destinationStation;
|
||||
const isFullRoute =
|
||||
!booking.originStationId &&
|
||||
booking.schedule?.originStation?.id === booking.schedule?.fullOriginStationId;
|
||||
return (
|
||||
<div>
|
||||
<div className="font-medium">
|
||||
|
||||
@@ -148,13 +148,6 @@ export default function ClassesPage() {
|
||||
<span className="font-mono text-sm">{(cls.baseFareMinor / 100).toFixed(2)} ETB</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'premiumMinor',
|
||||
label: 'Premium',
|
||||
render: (cls: any) => (
|
||||
<span className="font-mono text-sm">{cls.premiumMinor ? (cls.premiumMinor / 100).toFixed(2) : '0.00'} ETB</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'insuranceFeeMinor',
|
||||
label: 'Insurance',
|
||||
|
||||
@@ -108,6 +108,7 @@ export default function TariffRatesPage() {
|
||||
nationalityType: selectedNationalityType,
|
||||
bedPosition: selectedBedPosition || null,
|
||||
basePrice: Math.round(Number(fd.get('baseFareMinor') as string) * 100) || 0,
|
||||
insuranceFeeMinor: Math.round(Number(fd.get('insuranceFeeMinor') as string) * 100) || 0,
|
||||
isActive: fd.get('isActive') === 'true',
|
||||
};
|
||||
if (editingClass) {
|
||||
@@ -136,6 +137,9 @@ export default function TariffRatesPage() {
|
||||
c.bedPosition?.toLowerCase().includes(s) ||
|
||||
c.coachType?.name?.toLowerCase().includes(s)
|
||||
);
|
||||
}).sort((a: any, b: any) => {
|
||||
if (a.nationalityType === b.nationalityType) return 0;
|
||||
return a.nationalityType === 'LOCAL' ? -1 : 1;
|
||||
});
|
||||
|
||||
const suggestName = () => {
|
||||
@@ -171,12 +175,6 @@ export default function TariffRatesPage() {
|
||||
return <span className="text-sm">{ct ? `${ct.code} — ${ct.name}` : c.coachTypeId}</span>;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'bedPosition', label: 'Bed Position',
|
||||
render: (c: any) => c.bedPosition
|
||||
? <span className="font-mono text-sm">{c.bedPosition}</span>
|
||||
: <span className="text-muted-foreground text-xs">Standard</span>,
|
||||
},
|
||||
{
|
||||
key: 'name', label: 'Class Name',
|
||||
render: (c: any) => <span className="font-medium">{c.name}</span>,
|
||||
@@ -200,6 +198,12 @@ export default function TariffRatesPage() {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'insuranceFeeMinor', label: 'Insurance Fee',
|
||||
render: (c: any) => (
|
||||
<span className="font-mono text-sm">{c.insuranceFeeMinor ? (c.insuranceFeeMinor / 100).toFixed(2) : '0.00'} ETB</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'isActive', label: 'Status',
|
||||
render: (c: any) => (
|
||||
@@ -241,7 +245,7 @@ export default function TariffRatesPage() {
|
||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search by name, nationality, bed position..."
|
||||
placeholder="Search by name, nationality, etc."
|
||||
className="input pl-10 w-full"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
@@ -395,6 +399,20 @@ export default function TariffRatesPage() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="label">Insurance Fee (ETB)</label>
|
||||
<input
|
||||
type="number"
|
||||
name="insuranceFeeMinor"
|
||||
className="input"
|
||||
defaultValue={editingClass ? (editingClass.insuranceFeeMinor / 100).toFixed(2) : '0.00'}
|
||||
min="0"
|
||||
step="0.01"
|
||||
placeholder="e.g. 25.00"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground mt-1">Flat fee per passenger (e.g., travel insurance)</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="label">Status</label>
|
||||
<select name="isActive" className="input" defaultValue={editingClass?.isActive !== false ? 'true' : 'false'}>
|
||||
|
||||
Reference in New Issue
Block a user