@voplus/morpho-csp 11.2.8 → 11.3.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/LegalContactSelect/index.d.ts +7 -0
- package/es/components/LegalContactSelect/index.js +127 -12
- package/es/components/LegalContactSelect/index.js.map +1 -1
- package/es/data/clda-form/conversion.d.ts +9 -6
- package/es/data/clda-form/conversion.js +11 -18
- package/es/data/clda-form/conversion.js.map +1 -1
- package/es/data/clda-form/identityAdapter.d.ts +60 -0
- package/es/data/clda-form/identityAdapter.js +196 -0
- package/es/data/clda-form/identityAdapter.js.map +1 -0
- package/es/data/clda-form/interfaces.d.ts +20 -1
- package/es/data/clda-form/saveFormDraft.d.ts +4 -0
- package/es/data/clda-form/saveFormDraft.js +21 -0
- package/es/data/clda-form/saveFormDraft.js.map +1 -0
- package/es/data/clda-form/types.d.ts +31 -2
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.d.ts +35 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js +53 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js.map +1 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js +41 -15
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js.map +1 -1
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.d.ts +59 -1
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js +244 -15
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js.map +1 -1
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.d.ts +5 -0
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js +13 -7
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js +20 -24
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js +38 -11
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.d.ts +3 -3
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.d.ts +25 -4
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js +88 -5
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.d.ts +13 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js +20 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js.map +1 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js +28 -28
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js +3 -4
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js +16 -9
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js +128 -61
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js +119 -24
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.d.ts +0 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js +16 -8
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.d.ts +274 -23
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js +560 -210
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js.map +1 -1
- package/es/modules/corporate/components/CorporateSelect/index.d.ts +12 -1
- package/es/modules/corporate/components/CorporateSelect/index.js +19 -5
- package/es/modules/corporate/components/CorporateSelect/index.js.map +1 -1
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js +9 -6
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.d.ts +6 -1
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js +3 -2
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.d.ts +6 -1
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js +3 -2
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js +3 -3
- package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/IssueShares/interface.d.ts +1 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.d.ts +16 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js +27 -9
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/interface.d.ts +5 -2
- package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js +1 -1
- package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.d.ts +13 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js +24 -6
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/interface.d.ts +5 -2
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.d.ts +11 -3
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.js +9 -3
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.d.ts +31 -2
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js +52 -37
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.d.ts +27 -2
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js +78 -21
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.d.ts +17 -0
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js +36 -0
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.d.ts +11 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js +25 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/index.d.ts +7 -0
- package/es/modules/corporate/legal-generation/fields/state/index.js +5 -0
- package/es/modules/corporate/legal-generation/fields/state/index.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/types.d.ts +37 -0
- package/es/modules/corporate/legal-generation/fields/state/types.js +27 -0
- package/es/modules/corporate/legal-generation/fields/state/types.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.d.ts +28 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js +45 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.d.ts +31 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js +47 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.d.ts +35 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js +36 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.d.ts +15 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.js +27 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.js.map +1 -0
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.d.ts +18 -9
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js +130 -28
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js.map +1 -1
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.d.ts +27 -17
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js +112 -24
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js.map +1 -1
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.d.ts +637 -0
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js +840 -0
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js.map +1 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.d.ts +23 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js +55 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js.map +1 -0
- package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js +38 -8
- package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js +50 -33
- package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/ContactFields/index.d.ts +5 -2
- package/es/modules/self-registration/clda-form/components/ContactFields/index.js +6 -3
- package/es/modules/self-registration/clda-form/components/ContactFields/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/useContactEditSession.d.ts +35 -0
- package/es/modules/self-registration/clda-form/components/useContactEditSession.js +51 -0
- package/es/modules/self-registration/clda-form/components/useContactEditSession.js.map +1 -0
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js +60 -12
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js +3 -5
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js +7 -21
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js +6 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js +23 -28
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js +13 -8
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js +18 -9
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js +23 -28
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js +81 -14
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js +11 -15
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js +34 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js +4 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js +5 -4
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js +32 -12
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js +80 -13
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js +7 -9
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.d.ts +3 -0
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js +4 -2
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js +16 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js.map +1 -1
- package/es/routes.d.ts +1 -1
- package/es/routes.js +4 -2
- package/es/routes.js.map +1 -1
- package/package.json +4 -4
|
@@ -3,38 +3,126 @@ import { Form } from "antd";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { SubmitButton } from "../components";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
|
7
|
+
import { IDENTITY_FIELD_NAME, IDENTITY_SHAPE_FIELD_NAME, OPERATE_FIELD_NAME, } from "../fields/state";
|
|
8
|
+
import { saveLegalGeneration, validateLegalGenerationCapture, submitLegalGeneration, toReopenedLegalGeneration, } from "./legalGenerationSubmit";
|
|
9
|
+
/** The legal-generation document this wrapper form is composed for. */
|
|
10
|
+
const DOCUMENT_NAME = "Corporate Representative";
|
|
11
|
+
/** Compose the representative and parent data, retaining the returned saved capture. */
|
|
12
|
+
const CorporateRepresentativeForm = (props) => {
|
|
13
|
+
const [reopened, setReopened] = React.useState(props.reopened);
|
|
14
|
+
const [revision, setRevision] = React.useState(0);
|
|
15
|
+
const savedRef = React.useRef(props.reopened);
|
|
16
|
+
const inFlight = React.useRef(false);
|
|
17
|
+
const [pending, setPending] = React.useState(false);
|
|
18
|
+
const [identityFieldErrors, setIdentityFieldErrors] = React.useState({});
|
|
19
|
+
const application = useApplicationContext();
|
|
20
|
+
return (React.createElement(Form, { key: revision, layout: "vertical", disabled: pending, onFinish: onFinish, initialValues: {
|
|
21
|
+
// The company has no default: the submit endpoint requires a real corporate id, so an
|
|
22
|
+
// unpicked control has to read as empty for its required rule to report it.
|
|
23
|
+
Company: undefined,
|
|
9
24
|
ParentCompany: { Id: "", Name: "" },
|
|
10
25
|
Country: "",
|
|
26
|
+
RepresentativeCountry: "",
|
|
11
27
|
Date: "",
|
|
12
|
-
|
|
28
|
+
LegalContact: { id: "", name: "" },
|
|
13
29
|
Operate: "Search",
|
|
14
30
|
IdentityName: "",
|
|
15
|
-
|
|
31
|
+
IdentityShape: undefined,
|
|
16
32
|
IdentityNumber: "",
|
|
33
|
+
// Reopening a saved document seeds the fields the persisted content carries; the
|
|
34
|
+
// capture itself travels on the block's `identity` prop below (spec:3848).
|
|
35
|
+
...reopened?.values,
|
|
17
36
|
} },
|
|
18
|
-
React.createElement(CorporateRepresentativeFields,
|
|
19
|
-
React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
React.createElement(CorporateRepresentativeFields, { parentCompanyBaseline: reopened?.parentCompanyBaseline, companyDisabled: !!reopened, identityFieldErrors: identityFieldErrors, identity: reopened?.identity, mode: reopened ? (reopened.mode === "manual" ? "Create" : "Search") : undefined }),
|
|
38
|
+
React.createElement(Form.Item, { name: OPERATE_FIELD_NAME, noStyle: true, hidden: true }),
|
|
39
|
+
React.createElement(Form.Item, { name: IDENTITY_FIELD_NAME, noStyle: true, hidden: true }),
|
|
40
|
+
React.createElement(Form.Item, { name: IDENTITY_SHAPE_FIELD_NAME, noStyle: true, hidden: true }),
|
|
41
|
+
React.createElement(SubmitButton, { pending: pending })));
|
|
42
|
+
// spec:1930 — CSP: 使用“Select existing”模式时,表单发送所选实体的 id;手动模式发送用户键入的字段
|
|
43
|
+
// spec:3848 — CSP form identities retain their selected shape snapshot
|
|
44
|
+
// spec:3850 — CSP: 法律文书生成表单提交时把组合后的载荷送交转换
|
|
45
|
+
/**
|
|
46
|
+
* Composes the branch the user submitted and hands it to the conversion (spec:1930, spec:3850):
|
|
47
|
+
* `Search` carries the picked contact identity's id and drops the typed fields, `Create` carries
|
|
48
|
+
* the typed representative fields plus the complete captured snapshot under its own keys and no
|
|
49
|
+
* id. A refused handoff surfaces its message and leaves the form and its values untouched.
|
|
50
|
+
*
|
|
51
|
+
* A form reopened on a persisted document is *saved* instead of submitted (spec:3848): the submit
|
|
52
|
+
* endpoint always creates a new document, so resubmitting would duplicate the one the user opened,
|
|
53
|
+
* while the same-id save resolves the current mode and selection on the server and regenerates
|
|
54
|
+
* the existing ZIP. A successful returned capture seeds the next edit session.
|
|
55
|
+
*/
|
|
56
|
+
async function onFinish(values) {
|
|
57
|
+
if (inFlight.current)
|
|
58
|
+
return;
|
|
59
|
+
const errors = values.Operate === "Create" ? validateLegalGenerationCapture(values.Identity) : {};
|
|
60
|
+
setIdentityFieldErrors(errors);
|
|
61
|
+
if (Object.keys(errors).length)
|
|
62
|
+
return;
|
|
63
|
+
inFlight.current = true;
|
|
64
|
+
setPending(true);
|
|
65
|
+
try {
|
|
66
|
+
const { Company, ParentCompany, Country, LegalContact, Date, Operate } = values;
|
|
67
|
+
// `LegalContact` and `Identity` are separate keys on purpose: the picked contact can never be
|
|
68
|
+
// mistaken for — or overwritten by — the manual capture the shape seam writes (spec:1930).
|
|
69
|
+
const branch = Operate === "Search"
|
|
70
|
+
? // Select-existing: exactly the picked contact's id, no typed person field (spec:1930).
|
|
71
|
+
{ IdentityId: LegalContact?.id }
|
|
72
|
+
: {
|
|
73
|
+
// Manual: the typed representative fields plus the complete captured snapshot
|
|
74
|
+
// (spec:1930, spec:3848).
|
|
75
|
+
// spec:1930 — 手动代表国家进入 identity.country,母公司及签发国家独立。
|
|
76
|
+
Country: values.RepresentativeCountry,
|
|
77
|
+
IdentityName: values.IdentityName,
|
|
78
|
+
IdentityShape: values.IdentityShape,
|
|
79
|
+
IdentityNumber: values.IdentityNumber,
|
|
80
|
+
Identity: values.Identity,
|
|
81
|
+
};
|
|
82
|
+
const submission = {
|
|
83
|
+
documentName: DOCUMENT_NAME,
|
|
84
|
+
mode: Operate === "Search" ? "select-existing" : "manual",
|
|
85
|
+
branch,
|
|
86
|
+
company: Company,
|
|
87
|
+
parentCompany: ParentCompany,
|
|
88
|
+
parentCompanyCountry: Country,
|
|
89
|
+
parentCompanyDetails: values.ParentCompanyDetails,
|
|
90
|
+
documentDate: Date ? dayjs(Date).format("YYYY-MM-DD") : "",
|
|
91
|
+
};
|
|
92
|
+
const outcome = savedRef.current
|
|
93
|
+
? await saveLegalGeneration({
|
|
94
|
+
endpoint: application.api.currentEndPoint,
|
|
95
|
+
accessToken: application.user.info.accessToken,
|
|
96
|
+
id: savedRef.current.id,
|
|
97
|
+
submission,
|
|
98
|
+
})
|
|
99
|
+
: await submitLegalGeneration({
|
|
100
|
+
endpoint: application.api.currentEndPoint,
|
|
101
|
+
accessToken: application.user.info.accessToken,
|
|
102
|
+
submission,
|
|
103
|
+
});
|
|
104
|
+
// The returned server content becomes the next edit session and saved id; a failure leaves
|
|
105
|
+
// the controls and frozen capture mounted with every entered value intact.
|
|
106
|
+
if (outcome.result) {
|
|
107
|
+
const saved = toReopenedLegalGeneration({
|
|
108
|
+
id: outcome.result.id,
|
|
109
|
+
metaKey: outcome.result.metaKey,
|
|
110
|
+
name: outcome.result.document?.name ?? outcome.result.documentName,
|
|
111
|
+
country: "SGP",
|
|
112
|
+
content: outcome.result.content,
|
|
113
|
+
});
|
|
114
|
+
if (saved) {
|
|
115
|
+
savedRef.current = saved;
|
|
116
|
+
setReopened(saved);
|
|
117
|
+
setRevision((value) => value + 1);
|
|
118
|
+
}
|
|
28
119
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...identity,
|
|
36
|
-
};
|
|
37
|
-
console.log("CorporateRepresentative:", values, Values);
|
|
120
|
+
return outcome;
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
inFlight.current = false;
|
|
124
|
+
setPending(false);
|
|
125
|
+
}
|
|
38
126
|
}
|
|
39
127
|
};
|
|
40
128
|
export default CorporateRepresentativeForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CorporateRepresentativeForm.js","sourceRoot":"","sources":["../../../../../src/modules/corporate/legal-generation/form/CorporateRepresentativeForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CorporateRepresentativeForm.js","sourceRoot":"","sources":["../../../../../src/modules/corporate/legal-generation/form/CorporateRepresentativeForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,MAAM,OAAO,C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