loanshub-shared 1.3.5 → 1.3.6

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.
Files changed (62) hide show
  1. package/lib/app/documents.d.ts +4 -0
  2. package/lib/app/documents.js +8 -0
  3. package/lib/app/documents.js.map +1 -0
  4. package/lib/app/index.d.ts +2 -0
  5. package/lib/app/index.js +2 -0
  6. package/lib/app/index.js.map +1 -1
  7. package/lib/app/rateCapture.d.ts +23 -0
  8. package/lib/app/rateCapture.js +72 -0
  9. package/lib/app/rateCapture.js.map +1 -0
  10. package/lib/app/rateCapture.test.d.ts +1 -0
  11. package/lib/app/rateCapture.test.js +29 -0
  12. package/lib/app/rateCapture.test.js.map +1 -0
  13. package/lib/app/stages.d.ts +22 -0
  14. package/lib/app/stages.js +23 -1
  15. package/lib/app/stages.js.map +1 -1
  16. package/lib/app/stages.test.d.ts +1 -0
  17. package/lib/app/stages.test.js +27 -0
  18. package/lib/app/stages.test.js.map +1 -0
  19. package/lib/typings/loanshub/application.d.ts +6 -5
  20. package/lib/typings/loanshub/application.js.map +1 -1
  21. package/lib/typings/loanshub/rateReview.d.ts +18 -0
  22. package/lib/typings/loanshub/rateReview.js.map +1 -1
  23. package/lib/typings/salestrekker/index.d.ts +1 -0
  24. package/lib/typings/salestrekker/index.js +1 -0
  25. package/lib/typings/salestrekker/index.js.map +1 -1
  26. package/lib/typings/salestrekker/v2/address.d.ts +37 -0
  27. package/lib/typings/salestrekker/v2/address.js +7 -0
  28. package/lib/typings/salestrekker/v2/address.js.map +1 -0
  29. package/lib/typings/salestrekker/v2/asset.d.ts +48 -0
  30. package/lib/typings/salestrekker/v2/asset.js +7 -0
  31. package/lib/typings/salestrekker/v2/asset.js.map +1 -0
  32. package/lib/typings/salestrekker/v2/employment.d.ts +34 -0
  33. package/lib/typings/salestrekker/v2/employment.js +7 -0
  34. package/lib/typings/salestrekker/v2/employment.js.map +1 -0
  35. package/lib/typings/salestrekker/v2/expense.d.ts +27 -0
  36. package/lib/typings/salestrekker/v2/expense.js +7 -0
  37. package/lib/typings/salestrekker/v2/expense.js.map +1 -0
  38. package/lib/typings/salestrekker/v2/income.d.ts +51 -0
  39. package/lib/typings/salestrekker/v2/income.js +7 -0
  40. package/lib/typings/salestrekker/v2/income.js.map +1 -0
  41. package/lib/typings/salestrekker/v2/index.d.ts +11 -0
  42. package/lib/typings/salestrekker/v2/index.js +28 -0
  43. package/lib/typings/salestrekker/v2/index.js.map +1 -0
  44. package/lib/typings/salestrekker/v2/liability.d.ts +40 -0
  45. package/lib/typings/salestrekker/v2/liability.js +7 -0
  46. package/lib/typings/salestrekker/v2/liability.js.map +1 -0
  47. package/lib/typings/salestrekker/v2/needsAndObjectives.d.ts +62 -0
  48. package/lib/typings/salestrekker/v2/needsAndObjectives.js +7 -0
  49. package/lib/typings/salestrekker/v2/needsAndObjectives.js.map +1 -0
  50. package/lib/typings/salestrekker/v2/nextOfKin.d.ts +16 -0
  51. package/lib/typings/salestrekker/v2/nextOfKin.js +3 -0
  52. package/lib/typings/salestrekker/v2/nextOfKin.js.map +1 -0
  53. package/lib/typings/salestrekker/v2/person.d.ts +43 -0
  54. package/lib/typings/salestrekker/v2/person.js +8 -0
  55. package/lib/typings/salestrekker/v2/person.js.map +1 -0
  56. package/lib/typings/salestrekker/v2/productRequirements.d.ts +52 -0
  57. package/lib/typings/salestrekker/v2/productRequirements.js +7 -0
  58. package/lib/typings/salestrekker/v2/productRequirements.js.map +1 -0
  59. package/lib/typings/salestrekker/v2/ticket.d.ts +11 -0
  60. package/lib/typings/salestrekker/v2/ticket.js +6 -0
  61. package/lib/typings/salestrekker/v2/ticket.js.map +1 -0
  62. package/package.json +21 -21
@@ -0,0 +1,4 @@
1
+ /** The file types that can be attached to an application or to a message (lower case, without the dot). One list for the web app and the backend. */
2
+ export declare const DOCUMENT_ALLOWED_EXTENSIONS: readonly string[];
3
+ /** The largest file that can be attached, in bytes. */
4
+ export declare const DOCUMENT_MAX_BYTES: number;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCUMENT_MAX_BYTES = exports.DOCUMENT_ALLOWED_EXTENSIONS = void 0;
4
+ /** The file types that can be attached to an application or to a message (lower case, without the dot). One list for the web app and the backend. */
5
+ exports.DOCUMENT_ALLOWED_EXTENSIONS = ["pdf", "doc", "docx", "rtf", "odt", "ppt", "pptx", "xls", "xlsx", "csv", "txt", "png", "jpg", "jpeg", "gif", "bmp"];
6
+ /** The largest file that can be attached, in bytes. */
7
+ exports.DOCUMENT_MAX_BYTES = 10 * 1024 * 1024;
8
+ //# sourceMappingURL=documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/app/documents.ts"],"names":[],"mappings":";;;AAAA,qJAAqJ;AACxI,QAAA,2BAA2B,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEnL,uDAAuD;AAC1C,QAAA,kBAAkB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from "./options";
2
2
  export * from "./stages";
3
+ export * from "./rateCapture";
4
+ export * from "./documents";
3
5
  export type SemanticColors = "red" | "orange" | "yellow" | "olive" | "green" | "teal" | "blue" | "violet" | "purple" | "pink" | "brown" | "grey" | "black";
package/lib/app/index.js CHANGED
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./options"), exports);
18
18
  __exportStar(require("./stages"), exports);
19
+ __exportStar(require("./rateCapture"), exports);
20
+ __exportStar(require("./documents"), exports);
19
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B"}
@@ -0,0 +1,23 @@
1
+ import { RateReviewLifecycleStatus as Status } from "../typings/loanshub/rateReview";
2
+ /** The positions an application can be filtered by in the rate capture chain. Each is one or more stored lifecycle statuses. */
3
+ export type RateCaptureStepId = "notInvited" | "inviteSent" | "formOpened" | "formSubmitted" | "reviewInvited" | "reviewSubmitted" | "ineligible" | "refinanceEligible" | "refinanceInvited" | "refinanceApplied" | "refinanced" | "stopped";
4
+ export interface RateCaptureStep {
5
+ id: RateCaptureStepId;
6
+ text: string;
7
+ statuses: readonly Status[];
8
+ }
9
+ /** The steps in chain order. Every lifecycle status belongs to exactly one step. */
10
+ export declare const RATE_CAPTURE_STEPS: readonly RateCaptureStep[];
11
+ /** Whether a stored value is one of the lifecycle statuses. */
12
+ export declare const isRateReviewStatus: (value: unknown) => value is Status;
13
+ /** The step a lifecycle status belongs to. */
14
+ export declare const rateCaptureStepOf: (status: Status) => RateCaptureStepId;
15
+ /** The milestones the headline figures count: everyone who has reached the step, whether or not they are still on it. */
16
+ export type RateCaptureMilestoneId = "sent" | "opened" | "submitted" | "refinanceEligible" | "refinanceApplied" | "refinanced";
17
+ /** How far along the chain each milestone is. An application's progress is the furthest one it has evidence of. */
18
+ export declare const RATE_CAPTURE_MILESTONE_PROGRESS: Readonly<Record<RateCaptureMilestoneId, number>>;
19
+ /** The milestones in chain order. */
20
+ export declare const RATE_CAPTURE_MILESTONES: readonly RateCaptureMilestoneId[];
21
+ export declare const progressOfStatus: (status: Status) => number | undefined;
22
+ /** The financial year ("FY25" is 1 July 2024 to 30 June 2025) a date falls in, by the date in Brisbane. */
23
+ export declare function financialYearOf(date: Date): string;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.progressOfStatus = exports.RATE_CAPTURE_MILESTONES = exports.RATE_CAPTURE_MILESTONE_PROGRESS = exports.rateCaptureStepOf = exports.isRateReviewStatus = exports.RATE_CAPTURE_STEPS = void 0;
4
+ exports.financialYearOf = financialYearOf;
5
+ const rateReview_1 = require("../typings/loanshub/rateReview");
6
+ /** The steps in chain order. Every lifecycle status belongs to exactly one step. */
7
+ exports.RATE_CAPTURE_STEPS = [
8
+ { id: "notInvited", text: "Not invited", statuses: [rateReview_1.RateReviewLifecycleStatus.ReadyForRateCapture] },
9
+ { id: "inviteSent", text: "Invite sent", statuses: [rateReview_1.RateReviewLifecycleStatus.RateCaptureFormSent] },
10
+ { id: "formOpened", text: "Form opened", statuses: [rateReview_1.RateReviewLifecycleStatus.RateCaptureFormOpened] },
11
+ { id: "formSubmitted", text: "Form submitted", statuses: [rateReview_1.RateReviewLifecycleStatus.RateCaptureSubmitted, rateReview_1.RateReviewLifecycleStatus.WaitingForRateReview, rateReview_1.RateReviewLifecycleStatus.RateReviewDue] },
12
+ { id: "reviewInvited", text: "Rate review invited", statuses: [rateReview_1.RateReviewLifecycleStatus.RateReviewFormSent, rateReview_1.RateReviewLifecycleStatus.RateReviewFormOpened] },
13
+ { id: "reviewSubmitted", text: "Rate review submitted", statuses: [rateReview_1.RateReviewLifecycleStatus.RateReviewSubmitted, rateReview_1.RateReviewLifecycleStatus.PendingEligibilityCheck] },
14
+ { id: "ineligible", text: "Ineligible, closed", statuses: [rateReview_1.RateReviewLifecycleStatus.NotEligibleClosed] },
15
+ { id: "refinanceEligible", text: "Refinance eligible", statuses: [rateReview_1.RateReviewLifecycleStatus.RefinanceEligible] },
16
+ { id: "refinanceInvited", text: "Refinance invited", statuses: [rateReview_1.RateReviewLifecycleStatus.RefinanceInviteSent] },
17
+ { id: "refinanceApplied", text: "Refinance applied", statuses: [rateReview_1.RateReviewLifecycleStatus.RefinanceApplicationCreated, rateReview_1.RateReviewLifecycleStatus.RefinanceApplicationSubmitted] },
18
+ { id: "refinanced", text: "Refinanced", statuses: [rateReview_1.RateReviewLifecycleStatus.RefinanceSettled] },
19
+ {
20
+ id: "stopped",
21
+ text: "Stopped",
22
+ statuses: [rateReview_1.RateReviewLifecycleStatus.RateCaptureExpired, rateReview_1.RateReviewLifecycleStatus.RateReviewExpired, rateReview_1.RateReviewLifecycleStatus.EmailDeliveryFailed, rateReview_1.RateReviewLifecycleStatus.CustomerOptedOut, rateReview_1.RateReviewLifecycleStatus.LoanNoLongerActive, rateReview_1.RateReviewLifecycleStatus.FlowCancelled],
23
+ },
24
+ ];
25
+ const stepByStatus = new Map(exports.RATE_CAPTURE_STEPS.flatMap((step) => step.statuses.map((status) => [status, step.id])));
26
+ /** Whether a stored value is one of the lifecycle statuses. */
27
+ const isRateReviewStatus = (value) => typeof value === "string" && stepByStatus.has(value);
28
+ exports.isRateReviewStatus = isRateReviewStatus;
29
+ /** The step a lifecycle status belongs to. */
30
+ const rateCaptureStepOf = (status) => { var _a; return (_a = stepByStatus.get(status)) !== null && _a !== void 0 ? _a : "notInvited"; };
31
+ exports.rateCaptureStepOf = rateCaptureStepOf;
32
+ /** How far along the chain each milestone is. An application's progress is the furthest one it has evidence of. */
33
+ exports.RATE_CAPTURE_MILESTONE_PROGRESS = {
34
+ sent: 1,
35
+ opened: 2,
36
+ submitted: 3,
37
+ refinanceEligible: 6,
38
+ refinanceApplied: 7,
39
+ refinanced: 8,
40
+ };
41
+ /** The milestones in chain order. */
42
+ exports.RATE_CAPTURE_MILESTONES = ["sent", "opened", "submitted", "refinanceEligible", "refinanceApplied", "refinanced"];
43
+ /** How far along the chain a status shows an application to be; 0 before any invite. `undefined` for a status that ends the chain early (it says nothing about how far it got). */
44
+ const PROGRESS_BY_STATUS = {
45
+ [rateReview_1.RateReviewLifecycleStatus.ReadyForRateCapture]: 0,
46
+ [rateReview_1.RateReviewLifecycleStatus.RateCaptureFormSent]: 1,
47
+ [rateReview_1.RateReviewLifecycleStatus.RateCaptureFormOpened]: 2,
48
+ [rateReview_1.RateReviewLifecycleStatus.RateCaptureSubmitted]: 3,
49
+ [rateReview_1.RateReviewLifecycleStatus.WaitingForRateReview]: 3,
50
+ [rateReview_1.RateReviewLifecycleStatus.RateReviewDue]: 3,
51
+ [rateReview_1.RateReviewLifecycleStatus.RateReviewFormSent]: 4,
52
+ [rateReview_1.RateReviewLifecycleStatus.RateReviewFormOpened]: 4,
53
+ [rateReview_1.RateReviewLifecycleStatus.RateReviewSubmitted]: 5,
54
+ [rateReview_1.RateReviewLifecycleStatus.PendingEligibilityCheck]: 5,
55
+ [rateReview_1.RateReviewLifecycleStatus.NotEligibleClosed]: 5,
56
+ [rateReview_1.RateReviewLifecycleStatus.RefinanceEligible]: 6,
57
+ [rateReview_1.RateReviewLifecycleStatus.RefinanceInviteSent]: 6,
58
+ [rateReview_1.RateReviewLifecycleStatus.RefinanceApplicationCreated]: 7,
59
+ [rateReview_1.RateReviewLifecycleStatus.RefinanceApplicationSubmitted]: 7,
60
+ [rateReview_1.RateReviewLifecycleStatus.RefinanceSettled]: 8,
61
+ };
62
+ const progressOfStatus = (status) => PROGRESS_BY_STATUS[status];
63
+ exports.progressOfStatus = progressOfStatus;
64
+ /** The Brisbane business time zone has no daylight saving, so a fixed offset is exact. */
65
+ const BRISBANE_OFFSET_MS = 10 * 60 * 60 * 1000;
66
+ /** The financial year ("FY25" is 1 July 2024 to 30 June 2025) a date falls in, by the date in Brisbane. */
67
+ function financialYearOf(date) {
68
+ const local = new Date(date.getTime() + BRISBANE_OFFSET_MS);
69
+ const endYear = local.getUTCMonth() >= 6 ? local.getUTCFullYear() + 1 : local.getUTCFullYear();
70
+ return `FY${String(endYear).slice(-2)}`;
71
+ }
72
+ //# sourceMappingURL=rateCapture.js.map
@@ -0,0 +1 @@
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,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAAtF,QAAA,gBAAgB,oBAAsE;AAEnG,0FAA0F;AAC1F,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE/C,2GAA2G;AAC3G,SAAgB,eAAe,CAAC,IAAU;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,kBAAkB,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IAC/F,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rateReview_1 = require("../typings/loanshub/rateReview");
4
+ const rateCapture_1 = require("./rateCapture");
5
+ describe("rate capture steps", () => {
6
+ test("every lifecycle status is in exactly one step", () => {
7
+ const listed = rateCapture_1.RATE_CAPTURE_STEPS.flatMap((step) => step.statuses);
8
+ const all = Object.values(rateReview_1.RateReviewLifecycleStatus);
9
+ expect([...listed].sort()).toEqual([...all].sort());
10
+ });
11
+ test("a status finds its step", () => {
12
+ expect((0, rateCapture_1.rateCaptureStepOf)(rateReview_1.RateReviewLifecycleStatus.RateReviewDue)).toBe("formSubmitted");
13
+ expect((0, rateCapture_1.rateCaptureStepOf)(rateReview_1.RateReviewLifecycleStatus.RefinanceSettled)).toBe("refinanced");
14
+ expect((0, rateCapture_1.rateCaptureStepOf)(rateReview_1.RateReviewLifecycleStatus.CustomerOptedOut)).toBe("stopped");
15
+ });
16
+ test("progress follows the chain and is unknown for an early end", () => {
17
+ expect((0, rateCapture_1.progressOfStatus)(rateReview_1.RateReviewLifecycleStatus.RateCaptureFormOpened)).toBe(rateCapture_1.RATE_CAPTURE_MILESTONE_PROGRESS.opened);
18
+ expect((0, rateCapture_1.progressOfStatus)(rateReview_1.RateReviewLifecycleStatus.RefinanceSettled)).toBe(rateCapture_1.RATE_CAPTURE_MILESTONE_PROGRESS.refinanced);
19
+ expect((0, rateCapture_1.progressOfStatus)(rateReview_1.RateReviewLifecycleStatus.RateCaptureExpired)).toBeUndefined();
20
+ });
21
+ });
22
+ describe("financialYearOf", () => {
23
+ test("July in Brisbane starts the next financial year", () => {
24
+ expect((0, rateCapture_1.financialYearOf)(new Date("2024-06-30T13:59:59Z"))).toBe("FY24");
25
+ expect((0, rateCapture_1.financialYearOf)(new Date("2024-06-30T14:00:00Z"))).toBe("FY25");
26
+ expect((0, rateCapture_1.financialYearOf)(new Date("2025-01-15T00:00:00Z"))).toBe("FY25");
27
+ });
28
+ });
29
+ //# sourceMappingURL=rateCapture.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rateCapture.test.js","sourceRoot":"","sources":["../../src/app/rateCapture.test.ts"],"names":[],"mappings":";;AAAA,+DAA2E;AAC3E,+CAA0I;AAE1I,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACzD,MAAM,MAAM,GAAG,gCAAkB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,sCAAyB,CAAC,CAAC;QACrD,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAA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AC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -13,3 +13,25 @@ export interface IPortalStageOptions extends OptionItem<PortalStages> {
13
13
  color: SemanticColors;
14
14
  }
15
15
  export declare const PortalStageOptions: IPortalStageOptions[];
16
+ /** The stages an admin can list applications by (`Submitted` is only a moment while an application is sent to Salestrekker). */
17
+ export type ListedStage = PortalStages.Draft | PortalStages.InProgress | PortalStages.Settled | PortalStages.Lost;
18
+ /** The stage order everywhere: tabs, filters, and which stage wins if rules ever overlap. */
19
+ export declare const LISTED_STAGES: readonly ListedStage[];
20
+ /** The date an application is listed and ordered by within a stage. An application without it is not in the stage. */
21
+ export type StageDateField = "created" | "submitted" | "settlementDate";
22
+ export interface StageRule {
23
+ /** Stored flags that must all equal these values. */
24
+ where: Readonly<Record<string, boolean>>;
25
+ /** The date field the stage is ordered by, newest first. A stored application must have it to be in the stage. */
26
+ orderBy: StageDateField;
27
+ }
28
+ /**
29
+ * The one definition of each stage, as stored flags. Firestore queries use it as `where` clauses and an `orderBy`
30
+ * (an ordered field must exist, so it also confirms the date); `isInStage` applies the same rule in memory.
31
+ * The stages exclude each other.
32
+ */
33
+ export declare const PORTAL_STAGE_RULES: Readonly<Record<ListedStage, StageRule>>;
34
+ /** Whether a stored application is in the stage: every flag matches and the ordering date is there. */
35
+ export declare const isInStage: (application: Readonly<Record<string, unknown>>, stage: ListedStage) => boolean;
36
+ /** The stage a stored application is in, or `undefined` when its flags or dates fit none. */
37
+ export declare const stageOf: (application: Readonly<Record<string, unknown>>) => ListedStage | undefined;
package/lib/app/stages.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PortalStageOptions = exports.PortalStages = void 0;
3
+ exports.stageOf = exports.isInStage = exports.PORTAL_STAGE_RULES = exports.LISTED_STAGES = exports.PortalStageOptions = exports.PortalStages = void 0;
4
4
  var PortalStages;
5
5
  (function (PortalStages) {
6
6
  PortalStages["Draft"] = "Draft";
@@ -33,4 +33,26 @@ exports.PortalStageOptions = [
33
33
  text: "Lost",
34
34
  },
35
35
  ];
36
+ /** The stage order everywhere: tabs, filters, and which stage wins if rules ever overlap. */
37
+ exports.LISTED_STAGES = [PortalStages.InProgress, PortalStages.Settled, PortalStages.Lost, PortalStages.Draft];
38
+ /**
39
+ * The one definition of each stage, as stored flags. Firestore queries use it as `where` clauses and an `orderBy`
40
+ * (an ordered field must exist, so it also confirms the date); `isInStage` applies the same rule in memory.
41
+ * The stages exclude each other.
42
+ */
43
+ exports.PORTAL_STAGE_RULES = {
44
+ [PortalStages.InProgress]: { where: { isSubmitted: true, isLost: false, isSettled: false }, orderBy: "submitted" },
45
+ [PortalStages.Settled]: { where: { isSettled: true, isLost: false }, orderBy: "settlementDate" },
46
+ [PortalStages.Lost]: { where: { isLost: true, isSettled: false }, orderBy: "submitted" },
47
+ [PortalStages.Draft]: { where: { isSubmitted: false, isLost: false, isSettled: false }, orderBy: "created" },
48
+ };
49
+ /** Whether a stored application is in the stage: every flag matches and the ordering date is there. */
50
+ const isInStage = (application, stage) => {
51
+ const rule = exports.PORTAL_STAGE_RULES[stage];
52
+ return Object.keys(rule.where).every((field) => application[field] === rule.where[field]) && application[rule.orderBy] != null;
53
+ };
54
+ exports.isInStage = isInStage;
55
+ /** The stage a stored application is in, or `undefined` when its flags or dates fit none. */
56
+ const stageOf = (application) => exports.LISTED_STAGES.find((stage) => (0, exports.isInStage)(application, stage));
57
+ exports.stageOf = stageOf;
36
58
  //# sourceMappingURL=stages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stages.js","sourceRoot":"","sources":["../../src/app/stages.ts"],"names":[],"mappings":";;;AAGA,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,wDAAwD;IACxD,uCAAuB,CAAA;IACvB,gCAAgC;IAChC,yCAAyB,CAAA;IACzB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;AACf,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB;AAMY,QAAA,kBAAkB,GAA0B;IACvD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,KAAK,EAAE,MAAM;KACd;IACD;QACE,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,YAAY,CAAC,UAAU;QAC9B,KAAK,EAAE,OAAO;KACf;IACD;QACE,KAAK,EAAE,YAAY,CAAC,OAAO;QAC3B,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,SAAS;KAChB;IACD;QACE,KAAK,EAAE,YAAY,CAAC,IAAI;QACxB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC"}
1
+ {"version":3,"file":"stages.js","sourceRoot":"","sources":["../../src/app/stages.ts"],"names":[],"mappings":";;;AAGA,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,wDAAwD;IACxD,uCAAuB,CAAA;IACvB,gCAAgC;IAChC,yCAAyB,CAAA;IACzB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;AACf,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB;AAMY,QAAA,kBAAkB,GAA0B;IACvD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,KAAK,EAAE,MAAM;KACd;IACD;QACE,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,YAAY,CAAC,UAAU;QAC9B,KAAK,EAAE,OAAO;KACf;IACD;QACE,KAAK,EAAE,YAAY,CAAC,OAAO;QAC3B,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,SAAS;KAChB;IACD;QACE,KAAK,EAAE,YAAY,CAAC,IAAI;QACxB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC;AAKF,6FAA6F;AAChF,QAAA,aAAa,GAA2B,CAAC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,IA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,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,iBAAS,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AADlD,QAAA,OAAO,WAC2C"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const stages_1 = require("./stages");
4
+ const date = { seconds: 1 };
5
+ describe("stages", () => {
6
+ test("a submitted, open application is in progress", () => {
7
+ const app = { isSubmitted: true, isLost: false, isSettled: false, submitted: date };
8
+ expect((0, stages_1.stageOf)(app)).toBe(stages_1.PortalStages.InProgress);
9
+ });
10
+ test("settled needs the flag and a settlement date", () => {
11
+ expect((0, stages_1.stageOf)({ isSubmitted: true, isLost: false, isSettled: true, submitted: date, settlementDate: date })).toBe(stages_1.PortalStages.Settled);
12
+ expect((0, stages_1.stageOf)({ isSubmitted: true, isLost: false, isSettled: true, submitted: date })).toBeUndefined();
13
+ });
14
+ test("lost and draft", () => {
15
+ expect((0, stages_1.stageOf)({ isSubmitted: true, isLost: true, isSettled: false, submitted: date })).toBe(stages_1.PortalStages.Lost);
16
+ expect((0, stages_1.stageOf)({ isSubmitted: false, isLost: false, isSettled: false, created: date })).toBe(stages_1.PortalStages.Draft);
17
+ });
18
+ test("an application is in at most one stage", () => {
19
+ const apps = [
20
+ { isSubmitted: true, isLost: true, isSettled: true, submitted: date, settlementDate: date },
21
+ { isSubmitted: true, isLost: false, isSettled: true, submitted: date, settlementDate: date },
22
+ { isSubmitted: false, isLost: false, isSettled: false, created: date, submitted: date },
23
+ ];
24
+ apps.forEach((app) => expect(stages_1.LISTED_STAGES.filter((stage) => (0, stages_1.isInStage)(app, stage)).length).toBeLessThanOrEqual(1));
25
+ });
26
+ });
27
+ //# sourceMappingURL=stages.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stages.test.js","sourceRoot":"","sources":["../../src/app/stages.test.ts"],"names":[],"mappings":";;AAAA,qCAA2E;AAE3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K,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAY,CAAC,KAAK,CAAC,CAAC;IACnH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG;YACX,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;YAC3F,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;YAC5F,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;SACxF,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,sBAAa,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,kBAAS,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { LoanTypes, AppApplicant, AppAsset, AppLiability, AppAddress, YesNoValues } from ".";
2
2
  import { ContactNextOfKinRelationshipEnumerator, PaymentFrequencyEnumerator } from "../salestrekker";
3
3
  import { AppAttachment } from "./attachment";
4
- import { RateReviewFlowType, RateReviewLifecycleStatus } from "./rateReview";
4
+ import { RateReviewFlowType, RateReviewLifecycleStatus, RefinanceEligibility } from "./rateReview";
5
5
  export interface AppApplication<Timestamp> {
6
6
  title?: string;
7
7
  loanType: LoanTypes;
@@ -72,10 +72,11 @@ export interface AppApplication<Timestamp> {
72
72
  rateReviewFlowType?: RateReviewFlowType;
73
73
  /** Refinance application created from this rate-review flow. */
74
74
  rateReviewRefinanceApplicationId?: string;
75
- /** Original settled application whose rate-review invite created this refinance application. */
76
- rateReviewSourceApplicationId?: string;
77
- /** Identifies a copied application as part of the rate-review refinance journey. */
78
- isRateReviewRefinance?: boolean;
75
+ /** The application has previously been copied. */
76
+ isDuplicated?: boolean;
77
+ /** A rate-review refinance invitation has been sent for this application. */
78
+ hasRateReviewRefinanceInvite?: boolean;
79
+ refinanceEligibility?: RefinanceEligibility<Timestamp>;
79
80
  /** When the application was created in Firebase */
80
81
  created: Timestamp;
81
82
  /** when the application was submitted to Firebase, (and it left `Draft` status and was sent to Salestrekker) */
@@ -1 +1 @@
1
- {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../src/typings/loanshub/application.ts"],"names":[],"mappings":";;;AA8HA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,iDAAgC,CAAA;IAChC,0CAAyB,CAAA;AAC3B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../src/typings/loanshub/application.ts"],"names":[],"mappings":";;;AA+HA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,iDAAgC,CAAA;IAChC,0CAAyB,CAAA;AAC3B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
@@ -2,6 +2,24 @@ export interface RateReviewRecord<T> {
2
2
  sentDate: T;
3
3
  body: string;
4
4
  }
5
+ export interface RbaCashRate<Timestamp = unknown> {
6
+ effectiveDate: Timestamp;
7
+ rate: number;
8
+ source: string;
9
+ }
10
+ export interface RefinanceEligibility<Timestamp = unknown> {
11
+ approvalRate: number;
12
+ approvalRbaRate: number;
13
+ approvalDate: Timestamp | string;
14
+ currentRate: number;
15
+ currentRbaRate: number;
16
+ submittedAt: Timestamp | string;
17
+ marginBefore: number;
18
+ marginNow: number;
19
+ difference: number;
20
+ eligible: boolean;
21
+ decidedAt: Timestamp;
22
+ }
5
23
  export declare enum RateReviewFlowType {
6
24
  Regular = "REGULAR",
7
25
  Legacy = "LEGACY"
@@ -1 +1 @@
1
- {"version":3,"file":"rateReview.js","sourceRoot":"","sources":["../../../src/typings/loanshub/rateReview.ts"],"names":[],"mappings":";;;AAKA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;AACnB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,8EAA8E;AAC9E,IAAY,yBAuBX;AAvBD,WAAY,yBAAyB;IACnC,2EAA8C,CAAA;IAC9C,2EAA8C,CAAA;IAC9C,+EAAkD,CAAA;IAClD,4EAA+C,CAAA;IAC/C,6EAAgD,CAAA;IAChD,8DAAiC,CAAA;IACjC,yEAA4C,CAAA;IAC5C,6EAAgD,CAAA;IAChD,0EAA6C,CAAA;IAC7C,kFAAqD,CAAA;IACrD,sEAAyC,CAAA;IACzC,qEAAwC,CAAA;IACxC,0EAA6C,CAAA;IAC7C,0FAA6D,CAAA;IAC7D,8FAAiE,CAAA;IACjE,mEAAsC,CAAA;IACtC,wEAA2C,CAAA;IAC3C,sEAAyC,CAAA;IACzC,0EAA6C,CAAA;IAC7C,oEAAuC,CAAA;IACvC,yEAA4C,CAAA;IAC5C,6DAAgC,CAAA;AAClC,CAAC,EAvBW,yBAAyB,yCAAzB,yBAAyB,QAuBpC;AAEY,QAAA,+BAA+B,GAA8C;IACxF,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,EAAE,wBAAwB;IACzE,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,EAAE,wBAAwB;IACzE,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,EAAE,0BAA0B;IAC7E,CAAC,yBAAyB,CAAC,oBAAoB,CAAC,EAAE,wBAAwB;IAC1E,CAAC,yBAAyB,CAAC,oBAAoB,CAAC,EAAE,yBAAyB;IAC3E,CA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mB,CAAC,EAAE,uBAAuB;IACxE,CAAC,yBAAyB,CAAC,2BAA2B,CAAC,EAAE,+BAA+B;IACxF,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EAAE,iCAAiC;IAC5F,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,EAAE,mBAAmB;IACjE,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,sBAAsB;IACtE,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE,qBAAqB;IACpE,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,EAAE,uBAAuB;IACxE,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,EAAE,oBAAoB;IAClE,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE,uBAAuB;IACvE,CAAC,yBAAyB,CAAC,aAAa,CAAC,EAAE,gBAAgB;CAC5D,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./generated";
2
+ export * from "./v2";
2
3
  export declare enum salestrekkerWebHooks {
3
4
  dealCreated = "dealCreated",
4
5
  dealChangesStage = "dealChangesStage",
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.salestrekkerWebHooks = void 0;
18
18
  __exportStar(require("./generated"), exports);
19
+ __exportStar(require("./v2"), exports);
19
20
  var salestrekkerWebHooks;
20
21
  (function (salestrekkerWebHooks) {
21
22
  salestrekkerWebHooks["dealCreated"] = "dealCreated";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typings/salestrekker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAE5B,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mDAA2B,CAAA;IAC3B,6DAAqC,CAAA;IACrC,+DAAuC,CAAA;AACzC,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typings/salestrekker/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,uCAAqB;AAErB,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mDAA2B,CAAA;IAC3B,6DAAqC,CAAA;IACrC,+DAAuC,CAAA;AACzC,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Salestrekker 2.0 address structure, as sent to and returned by the API.
3
+ * Sits inside a person's `address` list.
4
+ */
5
+ /** Which of a person's addresses this is. */
6
+ export type StAddressType = "current" | "mailing" | "post_settlement";
7
+ export interface StAddress {
8
+ id: string;
9
+ /** "standard" for street addresses. */
10
+ addressType: string;
11
+ /** "AU"; empty for a blank address. */
12
+ countryCode: string;
13
+ country: string;
14
+ /** Lower case, e.g. "vic". */
15
+ state: string;
16
+ unitSuiteNumber: string;
17
+ streetNumber: string;
18
+ street: string;
19
+ streetType: string;
20
+ suburb: string;
21
+ city: string;
22
+ postCode: string;
23
+ formatted: string;
24
+ longitude: number;
25
+ latitude: number;
26
+ level: string;
27
+ buildingName: string;
28
+ addressLine1: string;
29
+ addressLine2: string;
30
+ poBoxType: string;
31
+ poBoxNumber: string;
32
+ exchange: string;
33
+ /** True when typed in rather than picked from an address search. */
34
+ isManual: boolean;
35
+ type: StAddressType;
36
+ addressFormat: string;
37
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 address structure, as sent to and returned by the API.
4
+ * Sits inside a person's `address` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/address.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Salestrekker 2.0 asset structure, as sent to and returned by the API.
3
+ * Sits inside a client profile's `asset` list.
4
+ */
5
+ /** One person's share of an asset. */
6
+ export interface StAssetOwnership {
7
+ idPerson: string;
8
+ percent: number;
9
+ }
10
+ /** Address of a property asset. */
11
+ export interface StAssetAddress {
12
+ addressFormat: string;
13
+ country: string;
14
+ countryCode: string;
15
+ isManual: boolean;
16
+ formatted: string;
17
+ streetNumber: string;
18
+ street: string;
19
+ streetType: string;
20
+ suburb: string;
21
+ /** Lower case, e.g. "vic". */
22
+ state: string;
23
+ postCode: string;
24
+ }
25
+ export interface StAsset {
26
+ /**
27
+ * "vehicles_make_and_model", "bank_account", "superfund_institutions", "home_content",
28
+ * "owner_occupied_properties", "investment_property_address", "secondary_residence_properties" or "other".
29
+ */
30
+ type: string;
31
+ value: number;
32
+ /** Sort order within the client profile. */
33
+ weight: number;
34
+ ownership: StAssetOwnership[];
35
+ name: string;
36
+ vehicle?: string;
37
+ vehicleModel?: string;
38
+ bankName?: string;
39
+ bankAccountType?: string;
40
+ membershipNumber?: string;
41
+ address?: StAssetAddress;
42
+ zoning?: string;
43
+ property?: string;
44
+ valuation?: string;
45
+ postSettlementStatus?: string;
46
+ rentalIncome?: number;
47
+ rentalIncomeFrequency?: string;
48
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 asset structure, as sent to and returned by the API.
4
+ * Sits inside a client profile's `asset` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=asset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/asset.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Salestrekker 2.0 employment structure, as sent to and returned by the API.
3
+ * Sits inside a person's `employment` list.
4
+ */
5
+ /** Where the employer operates from. */
6
+ export interface StEmploymentAddress {
7
+ addressFormat: string;
8
+ /** e.g. "principal_place_of_business". */
9
+ type: string;
10
+ countryCode: string;
11
+ country: string;
12
+ formatted: string;
13
+ isManual: boolean;
14
+ }
15
+ export interface StEmployment {
16
+ /** "current" for the job the applicant has now. */
17
+ status: string;
18
+ /** "salaried_employee" or "self_employed". */
19
+ type: string;
20
+ /** "primary" for the main job. */
21
+ priority: string;
22
+ /** Unix seconds. */
23
+ startDate: number;
24
+ /** e.g. "full_time", "sole_trader", "in_a_company". */
25
+ basis: string;
26
+ occupation: string;
27
+ isOnProbation: boolean;
28
+ /** Unix seconds; 0 when not on probation. */
29
+ probationExpiryDate: number;
30
+ /** Employer name. */
31
+ name: string;
32
+ employerType: string;
33
+ address: StEmploymentAddress;
34
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 employment structure, as sent to and returned by the API.
4
+ * Sits inside a person's `employment` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=employment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"employment.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/employment.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Salestrekker 2.0 expense structure, as sent to and returned by the API.
3
+ * Sits inside a client profile's `expense` list.
4
+ */
5
+ /** One person's (or company's) share of an expense. */
6
+ export interface StExpenseOwnership {
7
+ /** Set by Salestrekker on read; omitted when sending. */
8
+ id?: string;
9
+ idPerson: string;
10
+ idCompany: string;
11
+ percent: number;
12
+ }
13
+ /** A household expense line, e.g. groceries. */
14
+ export interface StHouseholdExpense {
15
+ /** An `ExpenseOptions` value, e.g. "groceries". */
16
+ type: string;
17
+ /** A payment frequency, e.g. "monthly". */
18
+ frequency: string;
19
+ value: number;
20
+ comment: string;
21
+ ownership: StExpenseOwnership[];
22
+ }
23
+ /** An entry of a client profile's `expense` list. */
24
+ export interface StExpenseGroup {
25
+ idPerson?: string[];
26
+ household?: StHouseholdExpense[];
27
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 expense structure, as sent to and returned by the API.
4
+ * Sits inside a client profile's `expense` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=expense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expense.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/expense.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Salestrekker 2.0 income structure, as sent to and returned by the API.
3
+ * Sits inside a client profile's `income` list.
4
+ */
5
+ export type StIncomeType = "payg_income" | "business_income" | "other_taxable_income" | "non_taxable_income";
6
+ /** Salary income from an employer. Every amount has its own frequency. */
7
+ export interface StPaygIncome {
8
+ type: "payg_income";
9
+ grossSalary: number;
10
+ grossSalaryFrequency: string;
11
+ bonus: number;
12
+ bonusFrequency: string;
13
+ overtimeEssential: number;
14
+ overtimeEssentialFrequency: string;
15
+ overtimeNonEssential: number;
16
+ overtimeNonEssentialFrequency: string;
17
+ commission: number;
18
+ commissionFrequency: string;
19
+ allowance: number;
20
+ allowanceFrequency: string;
21
+ idPerson: string;
22
+ idEmployer: string | null;
23
+ /** Sort order within the client profile. */
24
+ weight: number;
25
+ }
26
+ export interface StBusinessTaxYear {
27
+ profitBeforeTax: number;
28
+ taxYear: number;
29
+ }
30
+ /** Income from a business the person owns. */
31
+ export interface StBusinessIncome {
32
+ type: "business_income";
33
+ grossIncome: number;
34
+ grossIncomeFrequency: string;
35
+ lastTaxYear?: StBusinessTaxYear;
36
+ previousTaxYear?: StBusinessTaxYear;
37
+ idPerson: string;
38
+ idCompany: string | null;
39
+ weight: number;
40
+ }
41
+ /** Any other income with just an amount and a description. */
42
+ export interface StOtherIncome {
43
+ type: "other_taxable_income" | "non_taxable_income";
44
+ grossIncome: number;
45
+ grossIncomeFrequency: string;
46
+ description?: string;
47
+ idPerson: string;
48
+ idCompany: string | null;
49
+ weight: number;
50
+ }
51
+ export type StIncome = StPaygIncome | StBusinessIncome | StOtherIncome;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 income structure, as sent to and returned by the API.
4
+ * Sits inside a client profile's `income` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=income.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"income.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/income.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,11 @@
1
+ export * from "./address";
2
+ export * from "./asset";
3
+ export * from "./employment";
4
+ export * from "./expense";
5
+ export * from "./income";
6
+ export * from "./liability";
7
+ export * from "./needsAndObjectives";
8
+ export * from "./nextOfKin";
9
+ export * from "./person";
10
+ export * from "./productRequirements";
11
+ export * from "./ticket";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./address"), exports);
18
+ __exportStar(require("./asset"), exports);
19
+ __exportStar(require("./employment"), exports);
20
+ __exportStar(require("./expense"), exports);
21
+ __exportStar(require("./income"), exports);
22
+ __exportStar(require("./liability"), exports);
23
+ __exportStar(require("./needsAndObjectives"), exports);
24
+ __exportStar(require("./nextOfKin"), exports);
25
+ __exportStar(require("./person"), exports);
26
+ __exportStar(require("./productRequirements"), exports);
27
+ __exportStar(require("./ticket"), exports);
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B;AAC7B,4CAA0B;AAC1B,2CAAyB;AACzB,8CAA4B;AAC5B,uDAAqC;AACrC,8CAA4B;AAC5B,2CAAyB;AACzB,wDAAsC;AACtC,2CAAyB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Salestrekker 2.0 liability structure, as sent to and returned by the API.
3
+ * Sits inside a client profile's `liability` list.
4
+ */
5
+ /** One person's share of a liability. */
6
+ export interface StLiabilityOwnership {
7
+ idPerson: string;
8
+ percent: number;
9
+ }
10
+ export interface StLiability {
11
+ /** A liability type, e.g. "mortgage_loan", "credit_card", "buy_now_pay_later". */
12
+ type: string;
13
+ balance: number;
14
+ limit: number;
15
+ /** Lender name; "Lender" when none was captured. */
16
+ name: string;
17
+ lenderOtherName: string;
18
+ ownership: StLiabilityOwnership[];
19
+ postSettlementStatus: string;
20
+ repayment: number;
21
+ repaymentFrequency: string;
22
+ interestRate: number;
23
+ /** Sort order within the client profile. */
24
+ weight: number;
25
+ creditCardNumber?: string;
26
+ creditCardType?: string;
27
+ isReducedLimit?: boolean;
28
+ reducedLimit?: number;
29
+ accountNumber?: string;
30
+ bsb?: string;
31
+ /** Unix seconds; 0 when unset. */
32
+ endDate?: number;
33
+ idAsset?: string | null;
34
+ fixedExpiryDate?: number;
35
+ interestOnlyExpiryDate?: number;
36
+ mortgageType?: string;
37
+ rateType?: string;
38
+ repaymentType?: string;
39
+ asAtDate?: number;
40
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 liability structure, as sent to and returned by the API.
4
+ * Sits inside a client profile's `liability` list.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=liability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liability.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/liability.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Salestrekker 2.0 home loan "needs and objectives" structure, as sent to and returned by the API.
3
+ * Sits inside the ticket's home loan tool.
4
+ */
5
+ export interface StCreditHistory {
6
+ applicantHadProblems: string;
7
+ applicantBeenOfficerOrShareholder: string;
8
+ applicantHaveUnsatisfiedJudgements: string;
9
+ applicantSubmittedApplicationToOtherCreditProviders: string;
10
+ bankruptcy: string;
11
+ }
12
+ export interface StExitStrategy {
13
+ planningToRetire: number;
14
+ /** Salestrekker repayment values, e.g. "savings". */
15
+ applicantProposeToRepayLoan: string[];
16
+ }
17
+ export interface StFinancialSecurity {
18
+ howImportantIsLoanFlexibilityToYou: string;
19
+ levelOfFinancialExperience: string;
20
+ concernedAboutMovementsInInterestRates: string;
21
+ concernedAboutYourCurrentJobSecurity: string;
22
+ concernedAboutYourCurrentJobSecurityComments: string;
23
+ concernedAboutNegativePropertyValue: string;
24
+ concernedAboutNegativePropertyValueComments: string;
25
+ haveAnEmergencyFund: string;
26
+ ableToMaintainYourCommitmentsAndLifestyle: string;
27
+ haveAdequateInsurance: string;
28
+ haveWill: string;
29
+ awareOfAnyCircumstances: string;
30
+ }
31
+ export interface StFinancialChanges {
32
+ planChangesToTheirFinancialCircumstances: string;
33
+ }
34
+ /** The answers of one applicant. */
35
+ export interface StNeedsIndividual {
36
+ idPerson: string;
37
+ actingAsGuarantor: Record<string, never>;
38
+ creditHistory: StCreditHistory;
39
+ exitStrategy: StExitStrategy;
40
+ financialSecurity: StFinancialSecurity;
41
+ possibleAdverseChangesToFinancialSituation: StFinancialChanges;
42
+ possibleBeneficialChangesToFinancialSituation: StFinancialChanges;
43
+ }
44
+ export interface StNeedsNotes {
45
+ reasonForSeekingCredit: string;
46
+ immediateNeedsAndObjectives: string;
47
+ longerTerm: string;
48
+ }
49
+ /** What the loan is for: the property type and the loan purpose with its amount. */
50
+ export interface StRequirementsAndObjectives {
51
+ /** "owner_occupied" and/or "investment". */
52
+ type: string[];
53
+ purposeDetails: Array<{
54
+ type: string;
55
+ amount: number;
56
+ }>;
57
+ }
58
+ export interface StNeedsAndObjectives {
59
+ individuals: StNeedsIndividual[];
60
+ notes: StNeedsNotes;
61
+ requirementsAndObjectives?: StRequirementsAndObjectives;
62
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 home loan "needs and objectives" structure, as sent to and returned by the API.
4
+ * Sits inside the ticket's home loan tool.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=needsAndObjectives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"needsAndObjectives.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/needsAndObjectives.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Salestrekker 2.0 next of kin structure, as sent to and returned by the API.
3
+ * Sits inside a person's `nextOfKin` list.
4
+ */
5
+ import { StAddress } from "./address";
6
+ import { StContact } from "./person";
7
+ export interface StNextOfKin {
8
+ /** Lower case, e.g. "mr". */
9
+ title: string;
10
+ firstName: string;
11
+ lastName: string;
12
+ /** The relationship, e.g. "mother"; "other" when unknown. */
13
+ type: string;
14
+ contact: StContact[];
15
+ address: StAddress[];
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=nextOfKin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nextOfKin.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/nextOfKin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Salestrekker 2.0 person structure (name, contact and personal details),
3
+ * as sent to and returned by the API.
4
+ * Addresses, employment and next of kin are separate sections.
5
+ */
6
+ /** A contact method of a person, e.g. an email address or a mobile number. */
7
+ export interface StContact {
8
+ /** "email_personal" or "phone_mobile". */
9
+ type: string;
10
+ value: string;
11
+ /** Country prefix for phone numbers, e.g. "61"; empty for email. */
12
+ prefix: string;
13
+ }
14
+ /** The personal details part of a person, as sent when creating a ticket. */
15
+ export interface StPersonDetails {
16
+ name: string;
17
+ isActive: boolean;
18
+ contact: StContact[];
19
+ /** Lower case, e.g. "mr". */
20
+ title: string;
21
+ firstName: string;
22
+ middleName: string;
23
+ lastName: string;
24
+ preferredName: string;
25
+ gender: string;
26
+ /** Unix seconds. */
27
+ dateOfBirth: number;
28
+ countryOfResidency: string;
29
+ countryOfTaxResidence: string;
30
+ citizenshipOf: string;
31
+ countryOfBirth: string;
32
+ numberOfDependents: number;
33
+ /** Lower case, e.g. "single". */
34
+ maritalStatus: string;
35
+ labelId: string;
36
+ weight: number;
37
+ }
38
+ /** A person as returned by Salestrekker: the details above, as far as we read them. */
39
+ export interface StPerson extends Partial<Omit<StPersonDetails, "contact">> {
40
+ id?: string;
41
+ contact?: StContact[];
42
+ residencyStatus?: string;
43
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 person structure (name, contact and personal details),
4
+ * as sent to and returned by the API.
5
+ * Addresses, employment and next of kin are separate sections.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=person.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/person.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Salestrekker 2.0 home loan "product requirements" structure, as sent to and returned by the API.
3
+ * Sits inside the ticket's home loan tool.
4
+ */
5
+ /** How important a product feature is to the applicant, with the reasons behind it. */
6
+ export interface StProductChoice {
7
+ /** "important", "not_important", ... */
8
+ type: string;
9
+ preferredDuration?: string;
10
+ preferredRepaymentFrequency?: string;
11
+ /** Salestrekker reason values, e.g. "for_tax_purposes". */
12
+ reason?: string[];
13
+ otherReason?: string;
14
+ additionalReason?: string;
15
+ /** Line of credit only. */
16
+ planForPayingLineOfCredit?: string;
17
+ }
18
+ export interface StWhatIsImportant {
19
+ lowestOverallLoanCost?: string;
20
+ lowestOverallLoanCostComments?: string;
21
+ loanApprovedQuickly?: string;
22
+ loanApprovedQuicklyComments?: string;
23
+ specificLoanFeatures?: string;
24
+ lenderPolicy?: string;
25
+ goToBranch?: string;
26
+ useInternetBanking?: string;
27
+ }
28
+ export interface StTermOfCredit {
29
+ years?: number;
30
+ months?: number;
31
+ notLenders?: string;
32
+ preferredLenders?: string;
33
+ }
34
+ export interface StProductRequirements {
35
+ rateType: {
36
+ fixed: StProductChoice;
37
+ variable: StProductChoice;
38
+ fixedAndVariable: StProductChoice;
39
+ };
40
+ repaymentType: {
41
+ principalAndInterest: StProductChoice;
42
+ interestOnly: StProductChoice;
43
+ interestInAdvance: StProductChoice;
44
+ lineOfCredit: StProductChoice;
45
+ };
46
+ productType: {
47
+ offsetAccount: StProductChoice;
48
+ redraw: StProductChoice;
49
+ };
50
+ whatIsImportantForYou: StWhatIsImportant;
51
+ termOfCreditSought: StTermOfCredit;
52
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 home loan "product requirements" structure, as sent to and returned by the API.
4
+ * Sits inside the ticket's home loan tool.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=productRequirements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productRequirements.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/productRequirements.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Salestrekker 2.0 ticket (deal) structure, as sent to and returned by the API.
3
+ */
4
+ /** The loan summary on the ticket itself: its value and the generated description. */
5
+ export interface StTicketSummary {
6
+ value: {
7
+ total: number;
8
+ };
9
+ /** e.g. "Ann has applied for a Purchase loan of $500000 for a ownerOccupier property." */
10
+ description: string;
11
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Salestrekker 2.0 ticket (deal) structure, as sent to and returned by the API.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=ticket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticket.js","sourceRoot":"","sources":["../../../../src/typings/salestrekker/v2/ticket.ts"],"names":[],"mappings":";AAAA;;GAEG"}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "name": "loanshub-shared",
3
- "version": "1.3.5",
4
- "description": "shared package for loanshub",
5
- "main": "lib/index.js",
6
- "scripts": {
7
- "build": "tsc --build",
8
- "test": "npx jest"
9
- },
10
- "author": "Ricky Kenny",
11
- "files": [
12
- "lib/*"
13
- ],
14
- "devDependencies": {
15
- "@types/jest": "^29.5.13",
16
- "jest": "^29.7.0",
17
- "ts-jest": "^29.2.5",
18
- "typescript": "^5.6.3",
19
- "undici-types": "^8.10.0"
20
- }
21
- }
1
+ {
2
+ "name": "loanshub-shared",
3
+ "version": "1.3.6",
4
+ "description": "shared package for loanshub",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "build": "tsc --build",
8
+ "test": "npx jest"
9
+ },
10
+ "author": "Ricky Kenny",
11
+ "files": [
12
+ "lib/*"
13
+ ],
14
+ "devDependencies": {
15
+ "@types/jest": "^29.5.13",
16
+ "jest": "^29.7.0",
17
+ "ts-jest": "^29.2.5",
18
+ "typescript": "^5.6.3",
19
+ "undici-types": "^8.10.0"
20
+ }
21
+ }