@meetelise/chat 1.55.0 → 1.55.2
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/dist/src/WebComponent/FeeCalculator/components/charge-inputs/charge-inputs.d.ts +3 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +4 -1
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +3 -0
- package/dist/src/WebComponent/FeeCalculator/model/marketable-fee.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/utils/date-utils.d.ts +9 -0
- package/dist/src/WebComponent/FeeCalculator/utils/pet-limit-utils.d.ts +10 -0
- package/dist/src/globals.d.ts +0 -1
- package/dist/src/services/fees/calculateQuote.d.ts +14 -1
- package/package.json +1 -1
- package/public/dist/index.js +324 -295
- package/src/WebComponent/FeeCalculator/components/charge-inputs/charge-inputs.ts +44 -10
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +7 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +32 -1
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +16 -6
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +28 -13
- package/src/WebComponent/FeeCalculator/model/marketable-fee.ts +3 -0
- package/src/WebComponent/FeeCalculator/utils/date-utils.ts +17 -0
- package/src/WebComponent/FeeCalculator/utils/pet-limit-utils.ts +27 -0
- package/src/feeCalculatorMoveInDate.test.ts +113 -0
- package/src/feeCalculatorPetLimit.test.ts +346 -0
- package/src/globals.ts +0 -4
- package/src/services/fees/calculateQuote.ts +38 -3
|
@@ -7,10 +7,13 @@ export declare class ChargeInputsComponent extends LitElement {
|
|
|
7
7
|
chargeInputs: ChargeInputs;
|
|
8
8
|
onChargeInputsChange: ((newInputs: Partial<ChargeInputs>) => void) | null;
|
|
9
9
|
disabled: boolean;
|
|
10
|
+
maxPets: number | null;
|
|
10
11
|
rentableItems: RentableItemSummary[];
|
|
11
12
|
selectedRentableItems: DesiredRentableItem[];
|
|
12
13
|
onRentableItemAdd: ((item: DesiredRentableItem) => void) | null;
|
|
13
14
|
onRentableItemRemove: ((item: DesiredRentableItem) => void) | null;
|
|
15
|
+
private get totalPets();
|
|
16
|
+
private isAtPetLimit;
|
|
14
17
|
private handleIncrement;
|
|
15
18
|
private handleDecrement;
|
|
16
19
|
private updatePetCount;
|
|
@@ -5,7 +5,7 @@ import { MarketableFee, MarketableFeeFrequency } from "../../model/marketable-fe
|
|
|
5
5
|
import { RentableItemSummary } from "../../model";
|
|
6
6
|
import { Quote } from "../../model/quote";
|
|
7
7
|
import { FeeQuote } from "../../model/fee-quote";
|
|
8
|
-
import { ChargeInputs } from "../../../../services/fees/calculateQuote";
|
|
8
|
+
import { ChargeInputs, QuoteError } from "../../../../services/fees/calculateQuote";
|
|
9
9
|
import { DesiredRentableItem } from "../../model/desired-rentable-item";
|
|
10
10
|
import "../floor-plan-selector/floor-plan-selector";
|
|
11
11
|
import "../fee-card/fee-card";
|
|
@@ -18,6 +18,7 @@ export declare class FeeCalculatorLayout extends LitElement {
|
|
|
18
18
|
showSkeletonLoader: boolean;
|
|
19
19
|
selectedUnit: Unit | null;
|
|
20
20
|
quote: Quote | null;
|
|
21
|
+
quoteError: QuoteError | null;
|
|
21
22
|
layoutOptions: LayoutOption[];
|
|
22
23
|
selectedLayoutIds: number[];
|
|
23
24
|
groupedFees: Record<MarketableFeeFrequency, MarketableFee[]>;
|
|
@@ -31,6 +32,7 @@ export declare class FeeCalculatorLayout extends LitElement {
|
|
|
31
32
|
onLeaseTermChange: ((leaseTerm: number) => void) | null;
|
|
32
33
|
chargeInputs: ChargeInputs;
|
|
33
34
|
onChargeInputsChange: ((newInputs: Partial<ChargeInputs>) => void) | null;
|
|
35
|
+
maxPets: number | null;
|
|
34
36
|
selectedRentableItems: DesiredRentableItem[];
|
|
35
37
|
onRentableItemAdd: ((item: DesiredRentableItem) => void) | null;
|
|
36
38
|
onRentableItemRemove: ((item: DesiredRentableItem) => void) | null;
|
|
@@ -38,6 +40,7 @@ export declare class FeeCalculatorLayout extends LitElement {
|
|
|
38
40
|
renderRecurringFeeSection(title: string, fees: FeeQuote[]): TemplateResult | null;
|
|
39
41
|
renderFeeSections(): TemplateResult[];
|
|
40
42
|
renderTotalCost(): TemplateResult | null;
|
|
43
|
+
getQuoteErrorMessage(error: QuoteError): string;
|
|
41
44
|
renderFeesContent(): TemplateResult;
|
|
42
45
|
render(): TemplateResult;
|
|
43
46
|
}
|
|
@@ -34,8 +34,10 @@ export declare class FeeCalculator extends LitElement {
|
|
|
34
34
|
private incentives;
|
|
35
35
|
quote: Quote | null;
|
|
36
36
|
pdfUrl: string | null;
|
|
37
|
+
private quoteError;
|
|
37
38
|
private groupedFees;
|
|
38
39
|
private rentableItems;
|
|
40
|
+
private maxPets;
|
|
39
41
|
private units;
|
|
40
42
|
private isLoadingUnits;
|
|
41
43
|
private quoteAbortController;
|
|
@@ -44,6 +46,7 @@ export declare class FeeCalculator extends LitElement {
|
|
|
44
46
|
* Aborts any existing request, creates a new signal, and starts the API call.
|
|
45
47
|
*/
|
|
46
48
|
private startQuoteApiCall;
|
|
49
|
+
private clearQuote;
|
|
47
50
|
/**
|
|
48
51
|
* Performs the actual quote calculation API request.
|
|
49
52
|
*/
|
|
@@ -28,6 +28,7 @@ export interface MarketableFee {
|
|
|
28
28
|
fee_name: string;
|
|
29
29
|
amount?: number;
|
|
30
30
|
amount_display: string;
|
|
31
|
+
limit?: number | null;
|
|
31
32
|
min_estimate?: number;
|
|
32
33
|
max_estimate?: number;
|
|
33
34
|
percent_rent?: number;
|
|
@@ -54,6 +55,7 @@ export declare class MarketableFeeModel implements MarketableFee {
|
|
|
54
55
|
fee_name: string;
|
|
55
56
|
amount?: number;
|
|
56
57
|
amount_display: string;
|
|
58
|
+
limit: number | null;
|
|
57
59
|
min_estimate?: number;
|
|
58
60
|
max_estimate?: number;
|
|
59
61
|
percent_rent?: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a date as its local `yyyy-MM-dd` calendar date, the value format of a date input.
|
|
3
|
+
* `toISOString()` gives the UTC date instead, which can be a day off.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatLocalDate(date: Date): string;
|
|
6
|
+
/**
|
|
7
|
+
* Gets the prospect's local date today as `yyyy-MM-dd`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTodayString(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarketableFee } from "../model/marketable-fee";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the most pets a quote can include, or null when no pet fee has a limit.
|
|
4
|
+
* The quote counts every pet against each pet fee's limit, so the lowest limit caps the total.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getMaxPets(fees: MarketableFee[]): number | null;
|
|
7
|
+
/**
|
|
8
|
+
* Describes a pet limit, for example "Up to 2 pets allowed".
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatPetLimit(maxPets: number): string;
|
package/dist/src/globals.d.ts
CHANGED
|
@@ -17,9 +17,22 @@ declare type CalculateQuoteRequest = {
|
|
|
17
17
|
leaseTerm: number;
|
|
18
18
|
moveInDate: string;
|
|
19
19
|
};
|
|
20
|
+
export declare type FeeLimitViolation = {
|
|
21
|
+
feeId: string | null;
|
|
22
|
+
feeName: string;
|
|
23
|
+
itemCount: number;
|
|
24
|
+
limit: number;
|
|
25
|
+
};
|
|
26
|
+
export declare type QuoteError = {
|
|
27
|
+
type: "feeLimit";
|
|
28
|
+
violations: FeeLimitViolation[];
|
|
29
|
+
} | {
|
|
30
|
+
type: "unknown";
|
|
31
|
+
};
|
|
20
32
|
export declare type CalculateQuoteResponse = {
|
|
21
|
-
quote: Quote;
|
|
33
|
+
quote: Quote | null;
|
|
22
34
|
pdfUrl?: string;
|
|
35
|
+
error?: QuoteError;
|
|
23
36
|
};
|
|
24
37
|
export declare const calculateQuote: ({ buildingSlug, unitId, chargeInputs, rentableItems, leaseTerm, moveInDate, }: CalculateQuoteRequest, signal?: AbortSignal) => Promise<CalculateQuoteResponse>;
|
|
25
38
|
export default calculateQuote;
|