mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
feat(companies): let a co-operative switch back to eTrade as well
Both manual-registration routes exist for one reason — eTrade holds no record to fetch — so leaving one is the same act whichever it is. A co-operative that has since taken out a trade licence had no way out at all: the flag is chosen in the wizard, and an onboarded company can no longer reach it. revert-to-etrade now accepts either flag and strips both, and a co-operative's ACTIVE roles go back to Pending with it: those approvals were granted without a per-role business licence, because a co-op owes none, and the moment it stops being one that licence is due. Rejected, suspended and blacklisted roles are left alone — promoting a blocked role to "awaiting approval" would launder a staff decision away. An investor's roles are untouched; their licences were always due and already reviewed. Switching INTO a route stays with the wizard's nationality/role step, which owns the mutually-exclusive rules; a second entry point would restate all three.
This commit is contained in:
@@ -18,15 +18,21 @@ import type { ProfileResponse } from "@/types/profile";
|
||||
import { extractApiError } from "@/utils/result";
|
||||
|
||||
/**
|
||||
* Leave the foreign investment-licence route and go back to the ordinary eTrade
|
||||
* one — for a company that has since been registered with the trade registry,
|
||||
* or that ticked the box by mistake.
|
||||
* Leave whichever manual-registration route the company is on — a co-operative
|
||||
* union or farm, or a foreign investment licence — and go back to the ordinary
|
||||
* eTrade one. For a company that has since been registered with the trade
|
||||
* registry, or that ticked the box by mistake.
|
||||
*
|
||||
* It is a re-application, not a settings edit: the API clears the registration
|
||||
* the customer typed (nothing on file was ever checked against a licence) and
|
||||
* puts the company back to pending, so the wizard reopens on the company step
|
||||
* and the TIN goes through eTrade this time. Said plainly here rather than
|
||||
* discovered afterwards.
|
||||
*
|
||||
* Only the way OUT is here. Moving between the three registration sources in
|
||||
* the other direction is the wizard's own step, which this reopens — that is
|
||||
* where the rules about which combinations are legal already live, and a second
|
||||
* picker would have to restate every one of them.
|
||||
*/
|
||||
export default function RegistrationSourceCard({
|
||||
profile,
|
||||
@@ -61,7 +67,9 @@ export default function RegistrationSourceCard({
|
||||
onError: (err) => setError(extractApiError(err).message),
|
||||
});
|
||||
|
||||
if (!profile.investorLicence) return null;
|
||||
// Which of the two routes this is — wording only; leaving costs the same.
|
||||
const cooperative = profile.cooperative;
|
||||
if (!profile.investorLicence && !cooperative) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -72,9 +80,9 @@ export default function RegistrationSourceCard({
|
||||
</Group>
|
||||
<Stack gap="md">
|
||||
<Text size="sm" c="edr-muted">
|
||||
Your company is registered on a foreign investment licence, so your
|
||||
registration details were entered by hand instead of being read from
|
||||
eTrade. Our team reviews them against the documents you uploaded.
|
||||
{cooperative
|
||||
? "Your company is registered as a co-operative union or farm, so your registration details were entered by hand instead of being read from eTrade. Our team reviews them against the documents you uploaded."
|
||||
: "Your company is registered on a foreign investment licence, so your registration details were entered by hand instead of being read from eTrade. Our team reviews them against the documents you uploaded."}
|
||||
</Text>
|
||||
<Text size="sm" c="edr-muted">
|
||||
If your company now holds an eTrade trade licence, you can switch
|
||||
@@ -118,12 +126,25 @@ export default function RegistrationSourceCard({
|
||||
Your company goes back to pending and is reviewed again.
|
||||
</List.Item>
|
||||
<List.Item>
|
||||
Your documents, owner and contact details stay as they are.
|
||||
Your documents, owner and contact details stay as they are — but
|
||||
the papers we ask for change with the registration source, so some
|
||||
may be listed as outstanding again.
|
||||
</List.Item>
|
||||
{cooperative && (
|
||||
<List.Item>
|
||||
A business licence becomes due for each of your operational
|
||||
services — a co-operative owes none, an eTrade-registered
|
||||
company does — so any that are already approved go back to
|
||||
awaiting approval until you upload one. Their reference numbers
|
||||
stay the same.
|
||||
</List.Item>
|
||||
)}
|
||||
</List>
|
||||
<Alert color="amber" variant="light" icon={<AlertCircle size={18} />}>
|
||||
If eTrade holds no record for your TIN you won't be able to finish —
|
||||
come back here and re-select the investment licence in the wizard.
|
||||
the wizard reopens on the company step, so go back one step and
|
||||
re-select {cooperative ? "co-operative" : "the investment licence"}{" "}
|
||||
there.
|
||||
</Alert>
|
||||
{error && (
|
||||
<Text size="sm" c="red">
|
||||
|
||||
Reference in New Issue
Block a user