Skip to content

Commit 78733ae

Browse files
authored
Remove trust (#483)
1 parent 28c9469 commit 78733ae

File tree

6 files changed

+34
-471
lines changed

6 files changed

+34
-471
lines changed

tests/applications.spec.ts

Lines changed: 4 additions & 232 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11

22

33
import { createAddress, createFullName, createPhone } from "../helpers"
4-
import { Agent, BusinessApplication, CancelApplicationRequest, CreateBusinessApplicationRequest, CreateIndividualApplicationRequest, CreateSoleProprietorApplicationRequest, CreateTrustApplicationRequest, IndividualApplication, PatchApplicationRequest, PatchBusinessApplicationAttributes, PatchBusinessApplicationBeneficialOwner, RelationshipsArrayData, TrustApplication, Unit } from "../unit"
4+
import { Agent, BusinessApplication, CancelApplicationRequest, CreateBusinessApplicationRequest, CreateIndividualApplicationRequest, CreateSoleProprietorApplicationRequest, IndividualApplication, PatchApplicationRequest, PatchBusinessApplicationAttributes, PatchBusinessApplicationBeneficialOwner, RelationshipsArrayData, Unit } from "../unit"
55
import {
66
createIndividualApplication,
77
createBusinessApplication,
8-
createTrustApplication,
98
createIndividualApplicationWithRequiredDocument
109
} from "./testHelpers"
1110
import dotenv from "dotenv"
@@ -69,12 +68,6 @@ describe("Create Application", () => {
6968
const res = await unit.applications.get(createRes.data.id)
7069
expect(res.data.type).toBe("businessApplication")
7170
})
72-
73-
test("Create Trust Application", async () => {
74-
const createRes = await createTrustApplication(unit)
75-
const res = await unit.applications.get(createRes.data.id)
76-
expect(res.data.type).toBe("trustApplication")
77-
})
7871
})
7972

8073
describe("Applications", () => {
@@ -108,7 +101,7 @@ describe("Applications", () => {
108101
},
109102
"email": "[email protected]"
110103
}
111-
104+
112105
const app: IndividualApplication = {
113106
"type": "individualApplication",
114107
"id": "53",
@@ -637,227 +630,6 @@ describe("Business Applications", () => {
637630

638631
expect(updated_application.data.type).toBe("businessApplication")
639632
})
640-
})
641-
642-
643-
describe("TrustApplications", () => {
644-
test("Simulate trustApplication response from API", async () => {
645-
const app: TrustApplication = {
646-
"type": "trustApplication",
647-
"id": "51",
648-
"attributes": {
649-
"createdAt": "2022-04-02T21:59:46.324Z",
650-
"name": "Trust me Inc.",
651-
"contact": {
652-
"fullName": {
653-
"first": "Jared",
654-
"last": "Dunn"
655-
},
656-
"email": "[email protected]",
657-
"phone": {
658-
"countryCode": "1",
659-
"number": "2025550108"
660-
},
661-
"address": {
662-
"street": "5230 Newell Rd",
663-
"city": "Palo Alto",
664-
"state": "CA",
665-
"postalCode": "94303",
666-
"country": "US"
667-
}
668-
},
669-
"status": "AwaitingDocuments",
670-
"message": "Waiting for you to upload the required documents.",
671-
"stateOfIncorporation": "CA",
672-
"revocability": "Revocable",
673-
"sourceOfFunds": "Salary",
674-
"taxId": "123456789",
675-
"grantor": {
676-
"status": "PendingReview",
677-
"fullName": {
678-
"first": "Laurie",
679-
"last": "Bream"
680-
},
681-
"ssn": "000000003",
682-
"address": {
683-
"street": "950 Allerton Street",
684-
"city": "Redwood City",
685-
"state": "CA",
686-
"postalCode": "94063",
687-
"country": "US"
688-
},
689-
"dateOfBirth": "2000-01-01",
690-
"email": "[email protected]",
691-
"phone": {
692-
"countryCode": "1",
693-
"number": "2025550108"
694-
}
695-
},
696-
"tags": {
697-
"test": "test1"
698-
},
699-
"archived": false
700-
},
701-
"relationships": {
702-
"org": {
703-
"data": {
704-
"type": "org",
705-
"id": "1"
706-
}
707-
},
708-
"trustees": {
709-
"data": [
710-
{
711-
"type": "trustee",
712-
"id": "21"
713-
}
714-
]
715-
},
716-
"beneficiaries": {
717-
"data": [
718-
{
719-
"type": "beneficiary",
720-
"id": "33"
721-
},
722-
{
723-
"type": "beneficiary",
724-
"id": "34"
725-
}
726-
]
727-
},
728-
"documents": {
729-
"data": [
730-
{
731-
"type": "document",
732-
"id": "201"
733-
},
734-
{
735-
"type": "document",
736-
"id": "202"
737-
},
738-
{
739-
"type": "document",
740-
"id": "203"
741-
}
742-
]
743-
}
744-
}
745-
}
746-
747-
expect(app.type).toBe("trustApplication")
748-
expect(app.attributes.grantor.address.street).toBe("950 Allerton Street")
749-
})
750-
751-
test("Simulation CreateTrustApplicationRequest - test structure", () => {
752-
const req: CreateTrustApplicationRequest = {
753-
"type": "trustApplication",
754-
"attributes": {
755-
"name": "Trust me Inc.",
756-
"stateOfIncorporation": "CA",
757-
"revocability": "Revocable",
758-
"sourceOfFunds": "Salary",
759-
"taxId": "123456789",
760-
"trustees": [
761-
{
762-
"fullName": {
763-
"first": "Richard",
764-
"last": "Hendricks"
765-
},
766-
"dateOfBirth": "2000-01-01",
767-
"ssn": "000000002",
768-
"email": "[email protected]",
769-
"phone": {
770-
"countryCode": "1",
771-
"number": "2025550108"
772-
},
773-
"address": {
774-
"street": "5230 Newell Rd",
775-
"city": "Palo Alto",
776-
"state": "CA",
777-
"postalCode": "94303",
778-
"country": "US"
779-
}
780-
}
781-
],
782-
"contact": {
783-
"fullName": {
784-
"first": "Jared",
785-
"last": "Dunn"
786-
},
787-
"email": "[email protected]",
788-
"phone": {
789-
"countryCode": "1",
790-
"number": "2025550108"
791-
},
792-
"address": {
793-
"street": "5230 Newell Rd",
794-
"city": "Palo Alto",
795-
"state": "CA",
796-
"postalCode": "94303",
797-
"country": "US"
798-
}
799-
},
800-
"grantor": {
801-
"fullName": {
802-
"first": "Laurie",
803-
"last": "Bream"
804-
},
805-
"dateOfBirth": "2000-01-01",
806-
"ssn": "000000003",
807-
"email": "[email protected]",
808-
"phone": {
809-
"countryCode": "1",
810-
"number": "2025550108"
811-
},
812-
"address": {
813-
"street": "950 Allerton Street",
814-
"city": "Redwood City",
815-
"state": "CA",
816-
"postalCode": "94063",
817-
"country": "US"
818-
}
819-
},
820-
"tags": {
821-
"test": "test1"
822-
},
823-
"beneficiaries": [
824-
{
825-
"fullName": {
826-
"first": "Dinesh",
827-
"last": "Chugtai"
828-
},
829-
"dateOfBirth": "2000-01-01"
830-
},
831-
{
832-
"fullName": {
833-
"first": "Gilfoyle",
834-
"last": "Unknown"
835-
},
836-
"dateOfBirth": "2000-01-01"
837-
}
838-
]
839-
}
840-
}
841-
842-
expect(req.type).toBe("trustApplication")
843-
})
844-
845-
test("Simulation UpdateTrustApplicationRequest - test structure", () => {
846-
const req: PatchApplicationRequest = {
847-
applicationId: "123",
848-
data: {
849-
"type": "trustApplication",
850-
"attributes": {
851-
"tags": {
852-
"by": "Richard Hendricks",
853-
"id": "23033b64-38f8-4dbc-91a1-313ff0156d02"
854-
}
855-
}
856-
}
857-
}
858-
859-
expect(req.data.type).toBe("trustApplication")
860-
})
861633
})
862634

863635
describe("Applications", () => {
@@ -933,7 +705,7 @@ describe("Create and Close Application", () => {
933705
occupation: "Doctor"
934706
}
935707
}
936-
708+
937709
const createReq = await unit.applications.create(createIndividualApplication)
938710
expect(createReq.data.type).toBe("individualApplication")
939711
const closeRequest: CancelApplicationRequest = {
@@ -943,7 +715,7 @@ describe("Create and Close Application", () => {
943715
attributes: {
944716
reason: "By Org"
945717
}
946-
}
718+
}
947719
}
948720

949721
const closeRes = await unit.applications.cancel(closeRequest)

tests/cashDeposits.spec.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { DepositAccount, Unit } from "../unit"
1+
// import { DepositAccount, Unit } from "../unit"
2+
import { Unit } from "../unit"
23

34
import dotenv from "dotenv"
4-
import { createIndividualAccount } from "./testHelpers"
5-
import { GenerateBarcodeRequest } from "../types/cashDeposit"
6-
import { createRelationship } from "../helpers"
5+
// import { createIndividualAccount } from "./testHelpers"
6+
// import { GenerateBarcodeRequest } from "../types/cashDeposit"
7+
// import { createRelationship } from "../helpers"
78
dotenv.config()
89
const unit = new Unit(process.env.UNIT_TOKEN || "test", process.env.UNIT_API_URL || "test")
910

@@ -18,22 +19,22 @@ describe("Get Stores Locations", () => {
1819
})
1920

2021
describe("Generate Barcode", () => {
21-
async function getGenerateBarcodeRequest(): Promise<GenerateBarcodeRequest> {
22-
const account = (await createIndividualAccount(unit)).data
23-
24-
const request: GenerateBarcodeRequest = {
25-
type: "cashDepositBarcode",
26-
attributes: {
27-
storeId: "2433"
28-
},
29-
relationships: {
30-
customer: createRelationship("customer", (account as DepositAccount).relationships.customer?.data.id || ""),
31-
account: createRelationship("account", account.id)
32-
}
33-
}
34-
35-
return request
36-
}
22+
// async function getGenerateBarcodeRequest(): Promise<GenerateBarcodeRequest> {
23+
// const account = (await createIndividualAccount(unit)).data
24+
//
25+
// const request: GenerateBarcodeRequest = {
26+
// type: "cashDepositBarcode",
27+
// attributes: {
28+
// storeId: "2433"
29+
// },
30+
// relationships: {
31+
// customer: createRelationship("customer", (account as DepositAccount).relationships.customer?.data.id || ""),
32+
// account: createRelationship("account", account.id)
33+
// }
34+
// }
35+
//
36+
// return request
37+
// }
3738

3839
// test("Generate Barcode for a Cash Deposit store location",async () => {
3940
// const request = await getGenerateBarcodeRequest()

0 commit comments

Comments
 (0)