@pisell/pisellos 2.2.292 → 2.2.293
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/core/index.d.ts +7 -0
- package/dist/core/index.js +108 -65
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/modules/BookingContext/index.d.ts +3 -0
- package/dist/modules/BookingContext/index.js +42 -13
- package/dist/modules/BookingContext/types.d.ts +4 -4
- package/dist/modules/BookingContext/types.js +3 -3
- package/dist/modules/OpenData/types.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +19 -4
- package/dist/modules/Order/index.js +885 -485
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +93 -5
- package/dist/modules/Order/types.js +5 -0
- package/dist/modules/Order/utils.d.ts +12 -0
- package/dist/modules/Order/utils.js +96 -31
- package/dist/modules/Product/types.d.ts +2 -0
- package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/dist/modules/ProductList/clientDataVariants.js +216 -0
- package/dist/modules/ProductList/index.d.ts +18 -3
- package/dist/modules/ProductList/index.js +220 -38
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/modules/Quotation/index.d.ts +22 -0
- package/dist/modules/Quotation/index.js +293 -28
- package/dist/modules/ResourcePlanner/index.d.ts +0 -22
- package/dist/modules/ResourcePlanner/index.js +1 -180
- package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/dist/modules/ResourcePlanner/localClock.js +183 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
- package/dist/modules/ResourcePlanner/planner.js +2111 -958
- package/dist/modules/ResourcePlanner/types.d.ts +359 -187
- package/dist/modules/ResourcePlanner/types.js +33 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +17 -2
- package/dist/server/index.js +1134 -932
- package/dist/server/modules/floor-plan/index.d.ts +4 -0
- package/dist/server/modules/floor-plan/index.js +240 -98
- package/dist/server/modules/menu/index.js +48 -23
- package/dist/server/modules/order/index.d.ts +17 -7
- package/dist/server/modules/order/index.js +419 -207
- package/dist/server/modules/products/index.d.ts +10 -4
- package/dist/server/modules/products/index.js +177 -84
- package/dist/server/modules/resource/index.js +21 -13
- package/dist/server/utils/product.d.ts +1 -1
- package/dist/server/utils/product.js +186 -22
- package/dist/server/utils/small-ticket.d.ts +9 -1
- package/dist/server/utils/small-ticket.js +136 -41
- package/dist/solution/BaseSales/index.d.ts +26 -3
- package/dist/solution/BaseSales/index.js +1384 -905
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
- package/dist/solution/BaseSales/utils.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +4 -4
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +4 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/types.d.ts +2 -0
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +8 -3
- package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/dist/solution/UnifiedBookingSales/index.js +3877 -963
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/dist/solution/UnifiedBookingSales/types.js +4 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -0
- package/dist/solution/VenueBooking/index.js +549 -497
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/dist/utils/platform.d.ts +8 -0
- package/dist/utils/platform.js +15 -0
- package/lib/core/index.d.ts +7 -0
- package/lib/core/index.js +20 -2
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/modules/BookingContext/index.d.ts +3 -0
- package/lib/modules/BookingContext/index.js +35 -8
- package/lib/modules/BookingContext/types.d.ts +4 -4
- package/lib/modules/BookingContext/types.js +3 -3
- package/lib/modules/OpenData/types.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +19 -4
- package/lib/modules/Order/index.js +325 -28
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +93 -5
- package/lib/modules/Order/types.js +4 -0
- package/lib/modules/Order/utils.d.ts +12 -0
- package/lib/modules/Order/utils.js +85 -16
- package/lib/modules/Product/types.d.ts +2 -0
- package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
- package/lib/modules/ProductList/clientDataVariants.js +204 -0
- package/lib/modules/ProductList/index.d.ts +18 -3
- package/lib/modules/ProductList/index.js +137 -8
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/modules/Quotation/index.d.ts +22 -0
- package/lib/modules/Quotation/index.js +158 -11
- package/lib/modules/ResourcePlanner/index.d.ts +0 -22
- package/lib/modules/ResourcePlanner/index.js +9 -129
- package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
- package/lib/modules/ResourcePlanner/localClock.js +205 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
- package/lib/modules/ResourcePlanner/planner.js +1807 -783
- package/lib/modules/ResourcePlanner/types.d.ts +359 -187
- package/lib/modules/ResourcePlanner/types.js +13 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +17 -2
- package/lib/server/index.js +149 -21
- package/lib/server/modules/floor-plan/index.d.ts +4 -0
- package/lib/server/modules/floor-plan/index.js +60 -7
- package/lib/server/modules/menu/index.js +26 -4
- package/lib/server/modules/order/index.d.ts +17 -7
- package/lib/server/modules/order/index.js +194 -57
- package/lib/server/modules/products/index.d.ts +10 -4
- package/lib/server/modules/products/index.js +93 -23
- package/lib/server/modules/resource/index.js +12 -2
- package/lib/server/utils/product.d.ts +1 -1
- package/lib/server/utils/product.js +163 -3
- package/lib/server/utils/small-ticket.d.ts +9 -1
- package/lib/server/utils/small-ticket.js +126 -33
- package/lib/solution/BaseSales/index.d.ts +26 -3
- package/lib/solution/BaseSales/index.js +396 -70
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
- package/lib/solution/BaseSales/utils.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +4 -4
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/types.d.ts +2 -0
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +4 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
- package/lib/solution/UnifiedBookingSales/index.js +2592 -424
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
- package/lib/solution/UnifiedBookingSales/types.js +4 -6
- package/lib/solution/VenueBooking/index.d.ts +3 -0
- package/lib/solution/VenueBooking/index.js +33 -9
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/lib/utils/platform.d.ts +8 -0
- package/lib/utils/platform.js +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface LocalDateParts {
|
|
2
|
+
year: number;
|
|
3
|
+
month: number;
|
|
4
|
+
day: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LocalDateTimeParts extends LocalDateParts {
|
|
7
|
+
hour: number;
|
|
8
|
+
minute: number;
|
|
9
|
+
second: number;
|
|
10
|
+
}
|
|
11
|
+
type LocalDateInput = string | LocalDateParts;
|
|
12
|
+
type LocalDateTimeInput = string | number | LocalDateTimeParts;
|
|
13
|
+
export declare function parseLocalDate(value: string): LocalDateParts;
|
|
14
|
+
export declare function parseLocalDateTime(value: string): LocalDateTimeParts;
|
|
15
|
+
export declare function extractFixedOffsetMinutes(value: string | null | undefined): number | null;
|
|
16
|
+
export declare function captureRuntimeOffsetMinutes(value?: Date): number;
|
|
17
|
+
export declare function formatFixedOffset(offsetMinutes: number | null | undefined): string;
|
|
18
|
+
export declare function localDateTimeToScalar(value: LocalDateTimeParts): number;
|
|
19
|
+
export declare function localDateToScalar(value: Date): number;
|
|
20
|
+
export declare function localDateToScalarStart(value: LocalDateInput): number;
|
|
21
|
+
export declare function scalarToLocalDateParts(value: number): LocalDateParts;
|
|
22
|
+
export declare function scalarToLocalDateTimeParts(value: number): LocalDateTimeParts;
|
|
23
|
+
export declare function dateOrdinalFromLocalDate(value: LocalDateInput): number;
|
|
24
|
+
export declare function weekdayFromLocalDate(value: LocalDateInput): number;
|
|
25
|
+
export declare function formatLocalDate(value: LocalDateInput | number): string;
|
|
26
|
+
export declare function formatLocalTime(value: LocalDateTimeInput, includeSeconds?: boolean): string;
|
|
27
|
+
export declare function formatLocalDateTime(value: LocalDateTimeInput, fixedOffsetMinutes?: number | null): string;
|
|
28
|
+
export declare function addLocalMinutes(value: number, minutes: number): number;
|
|
29
|
+
export declare function addLocalHours(value: number, hours: number): number;
|
|
30
|
+
export declare function addLocalCalendarDays(value: number, days: number): number;
|
|
31
|
+
export declare function nextDate(value: LocalDateInput): string;
|
|
32
|
+
export declare function ceilLocalScalarToTenMinutes(value: number): number;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addLocalCalendarDays = addLocalCalendarDays;
|
|
7
|
+
exports.addLocalHours = addLocalHours;
|
|
8
|
+
exports.addLocalMinutes = addLocalMinutes;
|
|
9
|
+
exports.captureRuntimeOffsetMinutes = captureRuntimeOffsetMinutes;
|
|
10
|
+
exports.ceilLocalScalarToTenMinutes = ceilLocalScalarToTenMinutes;
|
|
11
|
+
exports.dateOrdinalFromLocalDate = dateOrdinalFromLocalDate;
|
|
12
|
+
exports.extractFixedOffsetMinutes = extractFixedOffsetMinutes;
|
|
13
|
+
exports.formatFixedOffset = formatFixedOffset;
|
|
14
|
+
exports.formatLocalDate = formatLocalDate;
|
|
15
|
+
exports.formatLocalDateTime = formatLocalDateTime;
|
|
16
|
+
exports.formatLocalTime = formatLocalTime;
|
|
17
|
+
exports.localDateTimeToScalar = localDateTimeToScalar;
|
|
18
|
+
exports.localDateToScalar = localDateToScalar;
|
|
19
|
+
exports.localDateToScalarStart = localDateToScalarStart;
|
|
20
|
+
exports.nextDate = nextDate;
|
|
21
|
+
exports.parseLocalDate = parseLocalDate;
|
|
22
|
+
exports.parseLocalDateTime = parseLocalDateTime;
|
|
23
|
+
exports.scalarToLocalDateParts = scalarToLocalDateParts;
|
|
24
|
+
exports.scalarToLocalDateTimeParts = scalarToLocalDateTimeParts;
|
|
25
|
+
exports.weekdayFromLocalDate = weekdayFromLocalDate;
|
|
26
|
+
const MINUTE_MS = 60 * 1000;
|
|
27
|
+
const HOUR_MS = 60 * MINUTE_MS;
|
|
28
|
+
function pad(value, size = 2) {
|
|
29
|
+
return String(value).padStart(size, '0');
|
|
30
|
+
}
|
|
31
|
+
function isFiniteInteger(value) {
|
|
32
|
+
return Number.isInteger(value) && Number.isFinite(value);
|
|
33
|
+
}
|
|
34
|
+
function assertDateParts(parts) {
|
|
35
|
+
if (!isFiniteInteger(parts.year) || !isFiniteInteger(parts.month) || !isFiniteInteger(parts.day)) {
|
|
36
|
+
throw new Error('Invalid local date parts');
|
|
37
|
+
}
|
|
38
|
+
const probe = new Date(Date.UTC(parts.year, parts.month - 1, parts.day));
|
|
39
|
+
if (probe.getUTCFullYear() !== parts.year || probe.getUTCMonth() !== parts.month - 1 || probe.getUTCDate() !== parts.day) {
|
|
40
|
+
throw new Error('Invalid local date');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function assertTimeParts(parts) {
|
|
44
|
+
if (!isFiniteInteger(parts.hour) || !isFiniteInteger(parts.minute) || !isFiniteInteger(parts.second) || parts.hour < 0 || parts.hour > 23 || parts.minute < 0 || parts.minute > 59 || parts.second < 0 || parts.second > 59) {
|
|
45
|
+
throw new Error('Invalid local time');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function localDateInputToParts(value) {
|
|
49
|
+
if (typeof value !== 'string') {
|
|
50
|
+
assertDateParts(value);
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
return parseLocalDate(value);
|
|
54
|
+
}
|
|
55
|
+
function scalarToDate(value) {
|
|
56
|
+
if (!Number.isFinite(value)) {
|
|
57
|
+
throw new Error('Invalid local scalar');
|
|
58
|
+
}
|
|
59
|
+
return new Date(value);
|
|
60
|
+
}
|
|
61
|
+
function parseLocalDate(value) {
|
|
62
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.trim());
|
|
63
|
+
if (!match) {
|
|
64
|
+
throw new Error(`Invalid local date: ${value}`);
|
|
65
|
+
}
|
|
66
|
+
const parts = {
|
|
67
|
+
year: Number(match[1]),
|
|
68
|
+
month: Number(match[2]),
|
|
69
|
+
day: Number(match[3])
|
|
70
|
+
};
|
|
71
|
+
assertDateParts(parts);
|
|
72
|
+
return parts;
|
|
73
|
+
}
|
|
74
|
+
function parseLocalDateTime(value) {
|
|
75
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d{1,9})?(?:[zZ]|[+-]\d{2}:\d{2})?$/.exec(value.trim());
|
|
76
|
+
if (!match) {
|
|
77
|
+
throw new Error(`Invalid local datetime: ${value}`);
|
|
78
|
+
}
|
|
79
|
+
const parts = {
|
|
80
|
+
year: Number(match[1]),
|
|
81
|
+
month: Number(match[2]),
|
|
82
|
+
day: Number(match[3]),
|
|
83
|
+
hour: Number(match[4]),
|
|
84
|
+
minute: Number(match[5]),
|
|
85
|
+
second: Number(match[6] || '0')
|
|
86
|
+
};
|
|
87
|
+
assertDateParts(parts);
|
|
88
|
+
assertTimeParts(parts);
|
|
89
|
+
return parts;
|
|
90
|
+
}
|
|
91
|
+
function extractFixedOffsetMinutes(value) {
|
|
92
|
+
if (!value) return null;
|
|
93
|
+
const trimmed = value.trim();
|
|
94
|
+
if (trimmed.toUpperCase() === 'Z') return 0;
|
|
95
|
+
const directMatch = /^([+-])(\d{2}):(\d{2})$/.exec(trimmed);
|
|
96
|
+
const suffixMatch = /([zZ]|[+-]\d{2}:\d{2})$/.exec(trimmed);
|
|
97
|
+
const target = directMatch ? trimmed : suffixMatch?.[1];
|
|
98
|
+
if (!target) return null;
|
|
99
|
+
if (target.toUpperCase() === 'Z') return 0;
|
|
100
|
+
const match = /^([+-])(\d{2}):(\d{2})$/.exec(target);
|
|
101
|
+
if (!match) return null;
|
|
102
|
+
const minutes = Number(match[2]) * 60 + Number(match[3]);
|
|
103
|
+
return match[1] === '-' ? -minutes : minutes;
|
|
104
|
+
}
|
|
105
|
+
function captureRuntimeOffsetMinutes(value = new Date()) {
|
|
106
|
+
return -value.getTimezoneOffset();
|
|
107
|
+
}
|
|
108
|
+
function formatFixedOffset(offsetMinutes) {
|
|
109
|
+
if (offsetMinutes === null || offsetMinutes === undefined) return '';
|
|
110
|
+
if (!Number.isFinite(offsetMinutes)) {
|
|
111
|
+
throw new Error('Invalid fixed offset');
|
|
112
|
+
}
|
|
113
|
+
const normalized = Math.trunc(offsetMinutes);
|
|
114
|
+
if (normalized === 0) return 'Z';
|
|
115
|
+
const sign = normalized >= 0 ? '+' : '-';
|
|
116
|
+
const absolute = Math.abs(normalized);
|
|
117
|
+
return `${sign}${pad(Math.floor(absolute / 60))}:${pad(absolute % 60)}`;
|
|
118
|
+
}
|
|
119
|
+
function localDateTimeToScalar(value) {
|
|
120
|
+
assertDateParts(value);
|
|
121
|
+
assertTimeParts(value);
|
|
122
|
+
return Date.UTC(value.year, value.month - 1, value.day, value.hour, value.minute, value.second, 0);
|
|
123
|
+
}
|
|
124
|
+
function localDateToScalar(value) {
|
|
125
|
+
return Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), 0);
|
|
126
|
+
}
|
|
127
|
+
function localDateToScalarStart(value) {
|
|
128
|
+
const parts = localDateInputToParts(value);
|
|
129
|
+
return Date.UTC(parts.year, parts.month - 1, parts.day, 0, 0, 0, 0);
|
|
130
|
+
}
|
|
131
|
+
function scalarToLocalDateParts(value) {
|
|
132
|
+
const date = scalarToDate(value);
|
|
133
|
+
return {
|
|
134
|
+
year: date.getUTCFullYear(),
|
|
135
|
+
month: date.getUTCMonth() + 1,
|
|
136
|
+
day: date.getUTCDate()
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function scalarToLocalDateTimeParts(value) {
|
|
140
|
+
const date = scalarToDate(value);
|
|
141
|
+
return {
|
|
142
|
+
year: date.getUTCFullYear(),
|
|
143
|
+
month: date.getUTCMonth() + 1,
|
|
144
|
+
day: date.getUTCDate(),
|
|
145
|
+
hour: date.getUTCHours(),
|
|
146
|
+
minute: date.getUTCMinutes(),
|
|
147
|
+
second: date.getUTCSeconds()
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function dateOrdinalFromLocalDate(value) {
|
|
151
|
+
const parts = localDateInputToParts(value);
|
|
152
|
+
return Math.floor(Date.UTC(parts.year, parts.month - 1, parts.day) / (24 * HOUR_MS));
|
|
153
|
+
}
|
|
154
|
+
function weekdayFromLocalDate(value) {
|
|
155
|
+
const parts = localDateInputToParts(value);
|
|
156
|
+
return new Date(Date.UTC(parts.year, parts.month - 1, parts.day)).getUTCDay();
|
|
157
|
+
}
|
|
158
|
+
function formatLocalDate(value) {
|
|
159
|
+
const parts = typeof value === 'number' ? scalarToLocalDateParts(value) : localDateInputToParts(value);
|
|
160
|
+
return `${pad(parts.year, 4)}-${pad(parts.month)}-${pad(parts.day)}`;
|
|
161
|
+
}
|
|
162
|
+
function formatLocalTime(value, includeSeconds = true) {
|
|
163
|
+
const parts = typeof value === 'number' ? scalarToLocalDateTimeParts(value) : typeof value === 'string' ? parseLocalDateTime(value) : value;
|
|
164
|
+
assertTimeParts(parts);
|
|
165
|
+
if (!includeSeconds) {
|
|
166
|
+
return `${pad(parts.hour)}:${pad(parts.minute)}`;
|
|
167
|
+
}
|
|
168
|
+
return `${pad(parts.hour)}:${pad(parts.minute)}:${pad(parts.second)}`;
|
|
169
|
+
}
|
|
170
|
+
function formatLocalDateTime(value, fixedOffsetMinutes) {
|
|
171
|
+
const parts = typeof value === 'number' ? scalarToLocalDateTimeParts(value) : typeof value === 'string' ? parseLocalDateTime(value) : value;
|
|
172
|
+
assertDateParts(parts);
|
|
173
|
+
assertTimeParts(parts);
|
|
174
|
+
return `${formatLocalDate(parts)}T${formatLocalTime(parts)}${formatFixedOffset(fixedOffsetMinutes)}`;
|
|
175
|
+
}
|
|
176
|
+
function addLocalMinutes(value, minutes) {
|
|
177
|
+
if (!Number.isFinite(minutes)) {
|
|
178
|
+
throw new Error('Invalid minute delta');
|
|
179
|
+
}
|
|
180
|
+
return value + Math.trunc(minutes) * MINUTE_MS;
|
|
181
|
+
}
|
|
182
|
+
function addLocalHours(value, hours) {
|
|
183
|
+
if (!Number.isFinite(hours)) {
|
|
184
|
+
throw new Error('Invalid hour delta');
|
|
185
|
+
}
|
|
186
|
+
return value + Math.trunc(hours) * HOUR_MS;
|
|
187
|
+
}
|
|
188
|
+
function addLocalCalendarDays(value, days) {
|
|
189
|
+
if (!Number.isFinite(days)) {
|
|
190
|
+
throw new Error('Invalid day delta');
|
|
191
|
+
}
|
|
192
|
+
const parts = scalarToLocalDateTimeParts(value);
|
|
193
|
+
return Date.UTC(parts.year, parts.month - 1, parts.day + Math.trunc(days), parts.hour, parts.minute, parts.second, 0);
|
|
194
|
+
}
|
|
195
|
+
function nextDate(value) {
|
|
196
|
+
return formatLocalDate(addLocalCalendarDays(localDateToScalarStart(value), 1));
|
|
197
|
+
}
|
|
198
|
+
function ceilLocalScalarToTenMinutes(value) {
|
|
199
|
+
const parts = scalarToLocalDateTimeParts(value);
|
|
200
|
+
const minuteRemainder = parts.minute % 10;
|
|
201
|
+
if (minuteRemainder === 0 && parts.second === 0) return value;
|
|
202
|
+
const deltaMinutes = parts.second === 0 ? 10 - minuteRemainder : minuteRemainder === 0 ? 10 : 10 - minuteRemainder;
|
|
203
|
+
const roundedBase = Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour, parts.minute, 0, 0);
|
|
204
|
+
return addLocalMinutes(roundedBase, deltaMinutes);
|
|
205
|
+
}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function evaluateResourceForInterval(params: {
|
|
7
|
-
resource: ResourcePlannerResource;
|
|
8
|
-
interval: ResourcePlannerDemandInterval;
|
|
9
|
-
context: Required<ResourcePlannerContextInput>;
|
|
10
|
-
}): ResourcePlannerAvailabilityCell;
|
|
11
|
-
export declare function queryPlannerAvailability(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerProjection;
|
|
12
|
-
export declare function resolveAssignableSlots(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
|
|
13
|
-
export declare function autoAssignResources(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerAssignmentResult;
|
|
14
|
-
export declare function validateAssignments(contextInput: ResourcePlannerContextInput, selection: ResourcePlannerSelection): ResourcePlannerValidationResult;
|
|
1
|
+
import type { AvailabilityProjection, AvailabilityProjectionInput, AvailabilityQuery, AvailabilityQueryResult, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, GetProductTimeRangesRequest, GetProductTimeRangesRuntimeOptions, ProductTimeRangeGroup } from './types';
|
|
2
|
+
export declare function createAvailabilityProjection(input: AvailabilityProjectionInput): AvailabilityProjection;
|
|
3
|
+
export declare function getProductTimeRanges(projection: AvailabilityProjection, request?: GetProductTimeRangesRequest, runtimeOptions?: GetProductTimeRangesRuntimeOptions): ProductTimeRangeGroup[];
|
|
4
|
+
export declare function queryAvailabilityProjection(projection: AvailabilityProjection, request: AvailabilityQuery): AvailabilityQueryResult;
|
|
5
|
+
export declare function validateAvailabilitySelection(projection: AvailabilityProjection, params: AvailabilitySelectionValidationParams): AvailabilitySelectionValidationResult;
|