mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 00:08:18 +00:00
fix: merge
This commit is contained in:
@@ -442,7 +442,9 @@ export default function NewContractPage({
|
|||||||
mutationFn: async (profileId: string) => {
|
mutationFn: async (profileId: string) => {
|
||||||
const res = await auth.reapplyProfile(profileId);
|
const res = await auth.reapplyProfile(profileId);
|
||||||
if (!res.success) {
|
if (!res.success) {
|
||||||
throw new Error(res.error?.message ?? "Failed to resubmit for approval");
|
throw new Error(
|
||||||
|
res.error?.message ?? "Failed to resubmit for approval",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSuccess: () => setPendingApprovalProfile(null),
|
onSuccess: () => setPendingApprovalProfile(null),
|
||||||
@@ -509,17 +511,6 @@ export default function NewContractPage({
|
|||||||
? (PROFILE_TYPE_LABELS[createTarget] ?? createTarget)
|
? (PROFILE_TYPE_LABELS[createTarget] ?? createTarget)
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
const onboardingDocs = useMemo(() => {
|
|
||||||
const profiles = auth.company?.company?.companyProfiles ?? [];
|
|
||||||
const targetType = operationType
|
|
||||||
? operationToProfileType(operationType, profileTypes)
|
|
||||||
: null;
|
|
||||||
const active =
|
|
||||||
(targetType && profiles.find((p) => p.type === targetType)) ??
|
|
||||||
profiles[0];
|
|
||||||
return active?.licenseFiles ?? [];
|
|
||||||
}, [auth.company, operationType, profileTypes]);
|
|
||||||
|
|
||||||
async function handleContinue() {
|
async function handleContinue() {
|
||||||
const fields = contractStepFields[step];
|
const fields = contractStepFields[step];
|
||||||
if (fields.length > 0) {
|
if (fields.length > 0) {
|
||||||
@@ -552,16 +543,16 @@ export default function NewContractPage({
|
|||||||
// GENERAL contract until its validity expires.
|
// GENERAL contract until its validity expires.
|
||||||
const cargoScope: Freight.CreateContractCargoScopeDto[] = isContainer
|
const cargoScope: Freight.CreateContractCargoScopeDto[] = isContainer
|
||||||
? data.enabledContainerSizes.map((size) => ({
|
? data.enabledContainerSizes.map((size) => ({
|
||||||
containerSize: size,
|
containerSize: size,
|
||||||
// Required cargo description — what the containers carry.
|
// Required cargo description — what the containers carry.
|
||||||
cargoFreeText: data.cargoFreeText.trim() || undefined,
|
cargoFreeText: data.cargoFreeText.trim() || undefined,
|
||||||
}))
|
}))
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
cargoTypeId: data.cargoTypePath?.[1] || undefined,
|
cargoTypeId: data.cargoTypePath?.[1] || undefined,
|
||||||
cargoFreeText: data.cargoFreeText || undefined,
|
cargoFreeText: data.cargoFreeText || undefined,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// Route — a single origin→destination lane, general contracts included.
|
// Route — a single origin→destination lane, general contracts included.
|
||||||
const routes: Freight.CreateContractRouteInputDto[] = [
|
const routes: Freight.CreateContractRouteInputDto[] = [
|
||||||
@@ -576,12 +567,12 @@ export default function NewContractPage({
|
|||||||
// a forwarder apart from a direct import/export).
|
// a forwarder apart from a direct import/export).
|
||||||
const forwarderProfileId =
|
const forwarderProfileId =
|
||||||
data.operationType &&
|
data.operationType &&
|
||||||
isForwarderOperation(data.operationType, profileTypes)
|
isForwarderOperation(data.operationType, profileTypes)
|
||||||
? (auth.company?.company?.companyProfiles ?? []).find(
|
? (auth.company?.company?.companyProfiles ?? []).find(
|
||||||
(p) =>
|
(p) =>
|
||||||
p.type ===
|
p.type ===
|
||||||
operationToProfileType(data.operationType!, profileTypes),
|
operationToProfileType(data.operationType!, profileTypes),
|
||||||
)?.id
|
)?.id
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -600,11 +591,11 @@ export default function NewContractPage({
|
|||||||
// booking time, but only on contracts created WITH_RETURN.
|
// booking time, but only on contracts created WITH_RETURN.
|
||||||
...(isContainer
|
...(isContainer
|
||||||
? {
|
? {
|
||||||
equipmentReturn:
|
equipmentReturn:
|
||||||
data.equipmentReturn === "with_return"
|
data.equipmentReturn === "with_return"
|
||||||
? "WITH_RETURN"
|
? "WITH_RETURN"
|
||||||
: "WITHOUT_RETURN",
|
: "WITHOUT_RETURN",
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
isHazardous: data.isHazardous,
|
isHazardous: data.isHazardous,
|
||||||
// Reefer is a contract-level flag for both container and bulk.
|
// Reefer is a contract-level flag for both container and bulk.
|
||||||
@@ -633,7 +624,8 @@ export default function NewContractPage({
|
|||||||
? { customsClearingEnabled: true }
|
? { customsClearingEnabled: true }
|
||||||
: {
|
: {
|
||||||
customsClearingEnabled: false,
|
customsClearingEnabled: false,
|
||||||
customsClearingAgent: data.customsClearingAgent?.trim() || undefined,
|
customsClearingAgent:
|
||||||
|
data.customsClearingAgent?.trim() || undefined,
|
||||||
}),
|
}),
|
||||||
cargoScope,
|
cargoScope,
|
||||||
routes,
|
routes,
|
||||||
@@ -748,10 +740,7 @@ export default function NewContractPage({
|
|||||||
<Text size="sm" fw={600}>
|
<Text size="sm" fw={600}>
|
||||||
What the reviewer asked for:
|
What the reviewer asked for:
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text size="sm" style={{ whiteSpace: "pre-wrap" }}>
|
||||||
size="sm"
|
|
||||||
style={{ whiteSpace: "pre-wrap" }}
|
|
||||||
>
|
|
||||||
{editContract.latestChangeRequestNote}
|
{editContract.latestChangeRequestNote}
|
||||||
</Text>
|
</Text>
|
||||||
<Text size="sm" c="dimmed" mt={2}>
|
<Text size="sm" c="dimmed" mt={2}>
|
||||||
@@ -1300,7 +1289,8 @@ export default function NewContractPage({
|
|||||||
<>
|
<>
|
||||||
<Text size="sm" c="dimmed">
|
<Text size="sm" c="dimmed">
|
||||||
Your {label} profile was submitted and is under staff
|
Your {label} profile was submitted and is under staff
|
||||||
review. You can start a contract under it once it's approved.
|
review. You can start a contract under it once it's
|
||||||
|
approved.
|
||||||
</Text>
|
</Text>
|
||||||
<Group justify="flex-end" gap="sm">
|
<Group justify="flex-end" gap="sm">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user