@d19n/youfibre-odin-sdk 1.0.213 → 1.0.215
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/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/ServiceAppointmentAccessor.d.ts +75 -0
- package/dist/accessors-v2/ServiceAppointmentAccessor.js +143 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +3 -1
- package/dist/actions-v2/NewAppointmentDto.d.ts +19 -0
- package/dist/actions-v2/NewAppointmentDto.js +19 -0
- package/dist/db-accessors-v2/ServiceAppointmentDbAccessor.d.ts +67 -0
- package/dist/db-accessors-v2/ServiceAppointmentDbAccessor.js +134 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +3 -1
- package/dist/db-sdk-v2/WorkOrderDb.d.ts +24 -24
- package/dist/db-sdk-v2/WorkOrderDb.js +68 -68
- package/dist/entities-v2/BlockageA55.d.ts +38 -38
- package/dist/entities-v2/BlockageA55.js +34 -34
- package/dist/entities-v2/InternalInstallAudit.d.ts +8 -8
- package/dist/entities-v2/InternalInstallAudit.js +4 -4
- package/dist/entities-v2/OutcomeFormInternalInstallAudit.d.ts +8 -8
- package/dist/entities-v2/OutcomeFormInternalInstallAudit.js +4 -4
- package/dist/entities-v2/OutcomeFormOverlayRealA55.d.ts +44 -44
- package/dist/entities-v2/OutcomeFormOverlayRealA55.js +37 -37
- package/dist/entities-v2/OutcomeFormRemediationRequiredReason.d.ts +102 -102
- package/dist/entities-v2/OutcomeFormRemediationRequiredReason.js +100 -100
- package/dist/records-v2/NoteRecord.d.ts +13 -0
- package/dist/records-v2/NoteRecord.js +23 -0
- package/dist/records-v2/ServiceAppointmentConfigRecord.d.ts +13 -0
- package/dist/records-v2/ServiceAppointmentConfigRecord.js +23 -0
- package/dist/records-v2/ServiceAppointmentRecord.d.ts +99 -0
- package/dist/records-v2/ServiceAppointmentRecord.js +164 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +110 -126
- package/dist/records-v2/WorkOrderRecord.js +196 -232
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +4 -1
- package/package.json +1 -1
- package/src/EntityRegistry.ts +2 -0
- package/src/OdinApiClient.ts +10 -0
- package/src/OdinDbClient.ts +10 -0
- package/src/accessors-v2/ServiceAppointmentAccessor.ts +165 -0
- package/src/accessors-v2/index.ts +1 -0
- package/src/actions-v2/NewAppointmentDto.ts +54 -0
- package/src/db-accessors-v2/ServiceAppointmentDbAccessor.ts +145 -0
- package/src/db-accessors-v2/index.ts +1 -0
- package/src/db-sdk-v2/WorkOrderDb.ts +151 -151
- package/src/entities-v2/BlockageA55.ts +45 -45
- package/src/entities-v2/InternalInstallAudit.ts +12 -12
- package/src/entities-v2/OutcomeFormInternalInstallAudit.ts +12 -12
- package/src/entities-v2/OutcomeFormOverlayRealA55.ts +54 -54
- package/src/entities-v2/OutcomeFormRemediationRequiredReason.ts +105 -105
- package/src/records-v2/NoteRecord.ts +30 -0
- package/src/records-v2/ServiceAppointmentConfigRecord.ts +30 -0
- package/src/records-v2/ServiceAppointmentRecord.ts +211 -0
- package/src/records-v2/WorkOrderRecord.ts +253 -303
- package/src/records-v2/index.ts +1 -0
package/dist/EntityRegistry.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ import { RemediationOutcomeFormAccessor } from './accessors-v2/RemediationOutcom
|
|
|
63
63
|
import { ReturnsAccessor } from './accessors-v2/ReturnsAccessor';
|
|
64
64
|
import { ScheduleSlotAccessor } from './accessors-v2/ScheduleSlotAccessor';
|
|
65
65
|
import { ServiceAccessor } from './accessors-v2/ServiceAccessor';
|
|
66
|
+
import { ServiceAppointmentAccessor } from './accessors-v2/ServiceAppointmentAccessor';
|
|
66
67
|
import { ServiceAppointmentConfigAccessor } from './accessors-v2/ServiceAppointmentConfigAccessor';
|
|
67
68
|
import { SiteSpecificRiskAssessmentOutcomeFormAccessor } from './accessors-v2/SiteSpecificRiskAssessmentOutcomeFormAccessor';
|
|
68
69
|
import { TeamAccessor } from './accessors-v2/TeamAccessor';
|
|
@@ -129,6 +130,7 @@ export declare const EntityRegistry: {
|
|
|
129
130
|
readonly Returns: typeof ReturnsAccessor;
|
|
130
131
|
readonly ScheduleSlot: typeof ScheduleSlotAccessor;
|
|
131
132
|
readonly Service: typeof ServiceAccessor;
|
|
133
|
+
readonly ServiceAppointment: typeof ServiceAppointmentAccessor;
|
|
132
134
|
readonly ServiceAppointmentConfig: typeof ServiceAppointmentConfigAccessor;
|
|
133
135
|
readonly SiteSpecificRiskAssessmentOutcomeForm: typeof SiteSpecificRiskAssessmentOutcomeFormAccessor;
|
|
134
136
|
readonly Team: typeof TeamAccessor;
|
package/dist/EntityRegistry.js
CHANGED
|
@@ -66,6 +66,7 @@ const RemediationOutcomeFormAccessor_1 = require("./accessors-v2/RemediationOutc
|
|
|
66
66
|
const ReturnsAccessor_1 = require("./accessors-v2/ReturnsAccessor");
|
|
67
67
|
const ScheduleSlotAccessor_1 = require("./accessors-v2/ScheduleSlotAccessor");
|
|
68
68
|
const ServiceAccessor_1 = require("./accessors-v2/ServiceAccessor");
|
|
69
|
+
const ServiceAppointmentAccessor_1 = require("./accessors-v2/ServiceAppointmentAccessor");
|
|
69
70
|
const ServiceAppointmentConfigAccessor_1 = require("./accessors-v2/ServiceAppointmentConfigAccessor");
|
|
70
71
|
const SiteSpecificRiskAssessmentOutcomeFormAccessor_1 = require("./accessors-v2/SiteSpecificRiskAssessmentOutcomeFormAccessor");
|
|
71
72
|
const TeamAccessor_1 = require("./accessors-v2/TeamAccessor");
|
|
@@ -132,6 +133,7 @@ exports.EntityRegistry = {
|
|
|
132
133
|
'Returns': ReturnsAccessor_1.ReturnsAccessor,
|
|
133
134
|
'ScheduleSlot': ScheduleSlotAccessor_1.ScheduleSlotAccessor,
|
|
134
135
|
'Service': ServiceAccessor_1.ServiceAccessor,
|
|
136
|
+
'ServiceAppointment': ServiceAppointmentAccessor_1.ServiceAppointmentAccessor,
|
|
135
137
|
'ServiceAppointmentConfig': ServiceAppointmentConfigAccessor_1.ServiceAppointmentConfigAccessor,
|
|
136
138
|
'SiteSpecificRiskAssessmentOutcomeForm': SiteSpecificRiskAssessmentOutcomeFormAccessor_1.SiteSpecificRiskAssessmentOutcomeFormAccessor,
|
|
137
139
|
'Team': TeamAccessor_1.TeamAccessor,
|
package/dist/OdinApiClient.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ import { RemediationOutcomeFormAccessor } from './accessors-v2/RemediationOutcom
|
|
|
73
73
|
import { ReturnsAccessor } from './accessors-v2/ReturnsAccessor';
|
|
74
74
|
import { ScheduleSlotAccessor } from './accessors-v2/ScheduleSlotAccessor';
|
|
75
75
|
import { ServiceAccessor } from './accessors-v2/ServiceAccessor';
|
|
76
|
+
import { ServiceAppointmentAccessor } from './accessors-v2/ServiceAppointmentAccessor';
|
|
76
77
|
import { ServiceAppointmentConfigAccessor } from './accessors-v2/ServiceAppointmentConfigAccessor';
|
|
77
78
|
import { SiteSpecificRiskAssessmentOutcomeFormAccessor } from './accessors-v2/SiteSpecificRiskAssessmentOutcomeFormAccessor';
|
|
78
79
|
import { TeamAccessor } from './accessors-v2/TeamAccessor';
|
|
@@ -148,6 +149,7 @@ export declare class OdinApiClient {
|
|
|
148
149
|
private _returnses?;
|
|
149
150
|
private _scheduleSlots?;
|
|
150
151
|
private _services?;
|
|
152
|
+
private _serviceAppointments?;
|
|
151
153
|
private _serviceAppointmentConfigs?;
|
|
152
154
|
private _siteSpecificRiskAssessmentOutcomeForms?;
|
|
153
155
|
private _teams?;
|
|
@@ -276,6 +278,8 @@ export declare class OdinApiClient {
|
|
|
276
278
|
get scheduleSlots(): ScheduleSlotAccessor;
|
|
277
279
|
/** Access Service records */
|
|
278
280
|
get services(): ServiceAccessor;
|
|
281
|
+
/** Access ServiceAppointment records */
|
|
282
|
+
get serviceAppointments(): ServiceAppointmentAccessor;
|
|
279
283
|
/** Access ServiceAppointmentConfig records */
|
|
280
284
|
get serviceAppointmentConfigs(): ServiceAppointmentConfigAccessor;
|
|
281
285
|
/** Access SiteSpecificRiskAssessmentOutcomeForm records */
|
package/dist/OdinApiClient.js
CHANGED
|
@@ -84,6 +84,7 @@ const RemediationOutcomeFormAccessor_1 = require("./accessors-v2/RemediationOutc
|
|
|
84
84
|
const ReturnsAccessor_1 = require("./accessors-v2/ReturnsAccessor");
|
|
85
85
|
const ScheduleSlotAccessor_1 = require("./accessors-v2/ScheduleSlotAccessor");
|
|
86
86
|
const ServiceAccessor_1 = require("./accessors-v2/ServiceAccessor");
|
|
87
|
+
const ServiceAppointmentAccessor_1 = require("./accessors-v2/ServiceAppointmentAccessor");
|
|
87
88
|
const ServiceAppointmentConfigAccessor_1 = require("./accessors-v2/ServiceAppointmentConfigAccessor");
|
|
88
89
|
const SiteSpecificRiskAssessmentOutcomeFormAccessor_1 = require("./accessors-v2/SiteSpecificRiskAssessmentOutcomeFormAccessor");
|
|
89
90
|
const TeamAccessor_1 = require("./accessors-v2/TeamAccessor");
|
|
@@ -489,6 +490,13 @@ class OdinApiClient {
|
|
|
489
490
|
}
|
|
490
491
|
return this._services;
|
|
491
492
|
}
|
|
493
|
+
/** Access ServiceAppointment records */
|
|
494
|
+
get serviceAppointments() {
|
|
495
|
+
if (!this._serviceAppointments) {
|
|
496
|
+
this._serviceAppointments = new ServiceAppointmentAccessor_1.ServiceAppointmentAccessor(this._provider);
|
|
497
|
+
}
|
|
498
|
+
return this._serviceAppointments;
|
|
499
|
+
}
|
|
492
500
|
/** Access ServiceAppointmentConfig records */
|
|
493
501
|
get serviceAppointmentConfigs() {
|
|
494
502
|
if (!this._serviceAppointmentConfigs) {
|
package/dist/OdinDbClient.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ import { RemediationOutcomeFormDbAccessor } from './db-accessors-v2/RemediationO
|
|
|
69
69
|
import { ReturnsDbAccessor } from './db-accessors-v2/ReturnsDbAccessor';
|
|
70
70
|
import { ScheduleSlotDbAccessor } from './db-accessors-v2/ScheduleSlotDbAccessor';
|
|
71
71
|
import { ServiceAppointmentConfigDbAccessor } from './db-accessors-v2/ServiceAppointmentConfigDbAccessor';
|
|
72
|
+
import { ServiceAppointmentDbAccessor } from './db-accessors-v2/ServiceAppointmentDbAccessor';
|
|
72
73
|
import { ServiceDbAccessor } from './db-accessors-v2/ServiceDbAccessor';
|
|
73
74
|
import { SiteSpecificRiskAssessmentOutcomeFormDbAccessor } from './db-accessors-v2/SiteSpecificRiskAssessmentOutcomeFormDbAccessor';
|
|
74
75
|
import { TeamDbAccessor } from './db-accessors-v2/TeamDbAccessor';
|
|
@@ -137,6 +138,7 @@ export declare class OdinDbClient {
|
|
|
137
138
|
private _returnses?;
|
|
138
139
|
private _scheduleSlots?;
|
|
139
140
|
private _serviceAppointmentConfigs?;
|
|
141
|
+
private _serviceAppointments?;
|
|
140
142
|
private _services?;
|
|
141
143
|
private _siteSpecificRiskAssessmentOutcomeForms?;
|
|
142
144
|
private _teams?;
|
|
@@ -261,6 +263,8 @@ export declare class OdinDbClient {
|
|
|
261
263
|
get scheduleSlots(): ScheduleSlotDbAccessor;
|
|
262
264
|
/** Access ServiceAppointmentConfig records */
|
|
263
265
|
get serviceAppointmentConfigs(): ServiceAppointmentConfigDbAccessor;
|
|
266
|
+
/** Access ServiceAppointment records */
|
|
267
|
+
get serviceAppointments(): ServiceAppointmentDbAccessor;
|
|
264
268
|
/** Access Service records */
|
|
265
269
|
get services(): ServiceDbAccessor;
|
|
266
270
|
/** Access SiteSpecificRiskAssessmentOutcomeForm records */
|
package/dist/OdinDbClient.js
CHANGED
|
@@ -72,6 +72,7 @@ const RemediationOutcomeFormDbAccessor_1 = require("./db-accessors-v2/Remediatio
|
|
|
72
72
|
const ReturnsDbAccessor_1 = require("./db-accessors-v2/ReturnsDbAccessor");
|
|
73
73
|
const ScheduleSlotDbAccessor_1 = require("./db-accessors-v2/ScheduleSlotDbAccessor");
|
|
74
74
|
const ServiceAppointmentConfigDbAccessor_1 = require("./db-accessors-v2/ServiceAppointmentConfigDbAccessor");
|
|
75
|
+
const ServiceAppointmentDbAccessor_1 = require("./db-accessors-v2/ServiceAppointmentDbAccessor");
|
|
75
76
|
const ServiceDbAccessor_1 = require("./db-accessors-v2/ServiceDbAccessor");
|
|
76
77
|
const SiteSpecificRiskAssessmentOutcomeFormDbAccessor_1 = require("./db-accessors-v2/SiteSpecificRiskAssessmentOutcomeFormDbAccessor");
|
|
77
78
|
const TeamDbAccessor_1 = require("./db-accessors-v2/TeamDbAccessor");
|
|
@@ -466,6 +467,13 @@ class OdinDbClient {
|
|
|
466
467
|
}
|
|
467
468
|
return this._serviceAppointmentConfigs;
|
|
468
469
|
}
|
|
470
|
+
/** Access ServiceAppointment records */
|
|
471
|
+
get serviceAppointments() {
|
|
472
|
+
if (!this._serviceAppointments) {
|
|
473
|
+
this._serviceAppointments = new ServiceAppointmentDbAccessor_1.ServiceAppointmentDbAccessor(this._principal, this._dbService);
|
|
474
|
+
}
|
|
475
|
+
return this._serviceAppointments;
|
|
476
|
+
}
|
|
469
477
|
/** Access Service records */
|
|
470
478
|
get services() {
|
|
471
479
|
if (!this._services) {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServiceAppointment Accessor
|
|
3
|
+
*
|
|
4
|
+
* Provides typed access to ServiceAppointment records via API.
|
|
5
|
+
* Returns wrapped records with typed action methods.
|
|
6
|
+
*
|
|
7
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
8
|
+
*/
|
|
9
|
+
import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
|
|
10
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
11
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
12
|
+
import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
|
|
13
|
+
import { ServiceAppointmentProperties } from '../entities-v2/ServiceAppointment';
|
|
14
|
+
import { ServiceAppointmentRecord } from '../records-v2/ServiceAppointmentRecord';
|
|
15
|
+
/** List response with wrapped records */
|
|
16
|
+
export interface ServiceAppointmentListResponse {
|
|
17
|
+
data: ServiceAppointmentRecord[];
|
|
18
|
+
hasMore: boolean;
|
|
19
|
+
totalRecords: number;
|
|
20
|
+
}
|
|
21
|
+
/** Search response with wrapped records */
|
|
22
|
+
export interface ServiceAppointmentSearchResponse {
|
|
23
|
+
records: ServiceAppointmentRecord[];
|
|
24
|
+
totalRecords: number;
|
|
25
|
+
hasMore: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class ServiceAppointmentAccessor {
|
|
28
|
+
private readonly _provider;
|
|
29
|
+
private readonly _moduleName;
|
|
30
|
+
private readonly _entityName;
|
|
31
|
+
constructor(provider: ApiProvider);
|
|
32
|
+
constructor(authParams: OauthParams);
|
|
33
|
+
constructor(authToken: string, host?: string);
|
|
34
|
+
get moduleName(): string;
|
|
35
|
+
get entityName(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get a single ServiceAppointment record by ID
|
|
38
|
+
*/
|
|
39
|
+
get(id: string): Promise<ServiceAppointmentRecord>;
|
|
40
|
+
/**
|
|
41
|
+
* Get multiple ServiceAppointment records by IDs
|
|
42
|
+
*/
|
|
43
|
+
getMany(ids: string[]): Promise<ServiceAppointmentRecord[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Search ServiceAppointment records
|
|
46
|
+
*/
|
|
47
|
+
search(params: Partial<OdinSearchV2>): Promise<ServiceAppointmentSearchResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Search all ServiceAppointment records with automatic pagination
|
|
50
|
+
*/
|
|
51
|
+
searchAll(params: Partial<OdinSearchV2>): Promise<ServiceAppointmentRecord[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Async generator for paginating through all matching records.
|
|
54
|
+
* Yields batches of wrapped records.
|
|
55
|
+
*/
|
|
56
|
+
paginate(params: Partial<OdinSearchV2>): AsyncGenerator<ServiceAppointmentRecord[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a fluent query builder for ServiceAppointment records
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const results = await accessor
|
|
63
|
+
* .query()
|
|
64
|
+
* .where('Status', 'in', ['Active', 'Pending'])
|
|
65
|
+
* .where('CreatedAt', 'gte', '2025-01-01')
|
|
66
|
+
* .select('id', 'title', 'properties.*')
|
|
67
|
+
* .sortBy('createdAt', 'desc')
|
|
68
|
+
* .limit(100)
|
|
69
|
+
* .execute();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
query(): QueryBuilder<ServiceAppointmentProperties, ServiceAppointmentRecord>;
|
|
73
|
+
/** Access the underlying ApiProvider */
|
|
74
|
+
get provider(): ApiProvider;
|
|
75
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ServiceAppointment Accessor
|
|
4
|
+
*
|
|
5
|
+
* Provides typed access to ServiceAppointment records via API.
|
|
6
|
+
* Returns wrapped records with typed action methods.
|
|
7
|
+
*
|
|
8
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
9
|
+
*/
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
20
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
21
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
22
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
23
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
24
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
25
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
26
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
27
|
+
function fulfill(value) { resume("next", value); }
|
|
28
|
+
function reject(value) { resume("throw", value); }
|
|
29
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.ServiceAppointmentAccessor = void 0;
|
|
33
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
34
|
+
const query_builder_1 = require("@d19n/odin-sdk-generator/dist/query-builder");
|
|
35
|
+
const ServiceAppointmentRecord_1 = require("../records-v2/ServiceAppointmentRecord");
|
|
36
|
+
class ServiceAppointmentAccessor {
|
|
37
|
+
constructor(providerOrAuth, host) {
|
|
38
|
+
this._moduleName = 'FieldServiceModule';
|
|
39
|
+
this._entityName = 'ServiceAppointment';
|
|
40
|
+
if (providerOrAuth instanceof api_provider_1.ApiProvider) {
|
|
41
|
+
this._provider = providerOrAuth;
|
|
42
|
+
}
|
|
43
|
+
else if (typeof providerOrAuth === 'string') {
|
|
44
|
+
// Auth token provided
|
|
45
|
+
this._provider = new api_provider_1.ApiProvider(host ? { host } : undefined, providerOrAuth);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// OauthParams provided
|
|
49
|
+
this._provider = new api_provider_1.ApiProvider(providerOrAuth);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
get moduleName() { return this._moduleName; }
|
|
53
|
+
get entityName() { return this._entityName; }
|
|
54
|
+
/**
|
|
55
|
+
* Get a single ServiceAppointment record by ID
|
|
56
|
+
*/
|
|
57
|
+
get(id) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const record = yield this._provider._getByPrimaryKey(this._moduleName, this._entityName, id);
|
|
60
|
+
return new ServiceAppointmentRecord_1.ServiceAppointmentRecord(record, this._provider);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get multiple ServiceAppointment records by IDs
|
|
65
|
+
*/
|
|
66
|
+
getMany(ids) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (ids.length === 0)
|
|
69
|
+
return [];
|
|
70
|
+
const records = yield this._provider._getManyByPrimaryKey(this._moduleName, this._entityName, ids);
|
|
71
|
+
return records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Search ServiceAppointment records
|
|
76
|
+
*/
|
|
77
|
+
search(params) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const result = yield this._provider._searchRecords(this._moduleName, this._entityName, params);
|
|
80
|
+
return {
|
|
81
|
+
records: result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider)),
|
|
82
|
+
totalRecords: result.totalRecords,
|
|
83
|
+
hasMore: result.hasMore,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Search all ServiceAppointment records with automatic pagination
|
|
89
|
+
*/
|
|
90
|
+
searchAll(params) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const result = yield this._provider._searchAllRecordsAndPaginate(this._moduleName, this._entityName, params);
|
|
93
|
+
return result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Async generator for paginating through all matching records.
|
|
98
|
+
* Yields batches of wrapped records.
|
|
99
|
+
*/
|
|
100
|
+
paginate(params) {
|
|
101
|
+
var _a;
|
|
102
|
+
return __asyncGenerator(this, arguments, function* paginate_1() {
|
|
103
|
+
let hasMore = true;
|
|
104
|
+
let searchAfter;
|
|
105
|
+
const query = Object.assign(Object.assign({}, params.query), { pageSize: ((_a = params.query) === null || _a === void 0 ? void 0 : _a.pageSize) || 500 });
|
|
106
|
+
while (hasMore) {
|
|
107
|
+
const result = yield __await(this._provider._searchRecords(this._moduleName, this._entityName, Object.assign(Object.assign({}, params), { query: Object.assign(Object.assign({}, query), { searchAfter }) })));
|
|
108
|
+
if (result.records.length > 0) {
|
|
109
|
+
yield yield __await(result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider)));
|
|
110
|
+
const lastRecord = result.records[result.records.length - 1];
|
|
111
|
+
searchAfter = lastRecord === null || lastRecord === void 0 ? void 0 : lastRecord.sort;
|
|
112
|
+
}
|
|
113
|
+
hasMore = result.hasMore && result.records.length >= query.pageSize;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// ============================================
|
|
118
|
+
// QUERY BUILDER
|
|
119
|
+
// ============================================
|
|
120
|
+
/**
|
|
121
|
+
* Create a fluent query builder for ServiceAppointment records
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const results = await accessor
|
|
126
|
+
* .query()
|
|
127
|
+
* .where('Status', 'in', ['Active', 'Pending'])
|
|
128
|
+
* .where('CreatedAt', 'gte', '2025-01-01')
|
|
129
|
+
* .select('id', 'title', 'properties.*')
|
|
130
|
+
* .sortBy('createdAt', 'desc')
|
|
131
|
+
* .limit(100)
|
|
132
|
+
* .execute();
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
query() {
|
|
136
|
+
return (0, query_builder_1.createQueryBuilder)(this);
|
|
137
|
+
}
|
|
138
|
+
/** Access the underlying ApiProvider */
|
|
139
|
+
get provider() {
|
|
140
|
+
return this._provider;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.ServiceAppointmentAccessor = ServiceAppointmentAccessor;
|
|
@@ -58,6 +58,7 @@ export { RemediationOutcomeFormAccessor, RemediationOutcomeFormSearchResponse, R
|
|
|
58
58
|
export { ReturnsAccessor, ReturnsSearchResponse, ReturnsListResponse } from './ReturnsAccessor';
|
|
59
59
|
export { ScheduleSlotAccessor, ScheduleSlotSearchResponse, ScheduleSlotListResponse } from './ScheduleSlotAccessor';
|
|
60
60
|
export { ServiceAppointmentConfigAccessor, ServiceAppointmentConfigSearchResponse, ServiceAppointmentConfigListResponse } from './ServiceAppointmentConfigAccessor';
|
|
61
|
+
export { ServiceAppointmentAccessor, ServiceAppointmentSearchResponse, ServiceAppointmentListResponse } from './ServiceAppointmentAccessor';
|
|
61
62
|
export { ServiceAccessor, ServiceSearchResponse, ServiceListResponse } from './ServiceAccessor';
|
|
62
63
|
export { SiteSpecificRiskAssessmentOutcomeFormAccessor, SiteSpecificRiskAssessmentOutcomeFormSearchResponse, SiteSpecificRiskAssessmentOutcomeFormListResponse } from './SiteSpecificRiskAssessmentOutcomeFormAccessor';
|
|
63
64
|
export { TeamAccessor, TeamSearchResponse, TeamListResponse } from './TeamAccessor';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.ReturnsAccessor = exports.RemediationOutcomeFormAccessor = exports.PushNotificationAccessor = exports.ProductAccessor = exports.PriceBookAccessor = exports.PermissionToFailAccessor = exports.PaymentAccessor = exports.PaymentMethodRefundAccessor = exports.PaymentMethodAccessor = exports.PICRequestAccessor = exports.OverlayRealA55Accessor = exports.OutageAccessor = exports.OrderAccessor = exports.OrderItemAccessor = exports.OrderCheckAccessor = exports.OntReplacementApprovalAccessor = exports.OneTouchSwitchAccessor = exports.OhExternalAuditAccessor = exports.OfferAccessor = exports.NoteAccessor = exports.NetworkDeviceAccessor = exports.LeadAccessor = exports.KnowledgeArticleAccessor = exports.InvoiceAccessor = exports.ImpersonationTrackerAccessor = exports.FieldServiceProductAccessor = exports.FieldServiceDispatchedProductAccessor = exports.EmailTemplateAccessor = exports.EmailAccessor = exports.DiscountAccessor = exports.CustomerPhonePortingAccessor = exports.CustomerDeviceRouterAccessor = exports.CustomerDeviceOntAccessor = exports.CustomerDeviceAtaAccessor = exports.CrmDatasetAccessor = exports.CreditNoteAccessor = exports.ConversationAccessor = exports.ContractBuyOutAccessor = exports.ContactAccessor = exports.ConfigAccessor = exports.ChurnRequestAccessor = exports.ChangeReasonAccessor = exports.CaseAccessor = exports.CallLegAccessor = exports.BillingRequestAccessor = exports.BillingAdjustmentAccessor = exports.AddressAccessor = exports.ActivityAccessor = exports.ActivityLogAccessor = exports.AccountAccessor = void 0;
|
|
12
|
-
exports.YfFieldServiceVisitAccessor = exports.WorkOrderStatusUpdateAccessor = exports.WorkOrderAccessor = exports.WayleaveAuditAccessor = exports.VoiceConfigurationAccessor = exports.VisitAccessor = exports.UserAccessor = exports.UgRetroAuditAccessor = exports.TransactionAccessor = exports.TimeSlotAccessor = exports.TeamAccessor = exports.SiteSpecificRiskAssessmentOutcomeFormAccessor = exports.ServiceAccessor = exports.ServiceAppointmentConfigAccessor = exports.ScheduleSlotAccessor = void 0;
|
|
12
|
+
exports.YfFieldServiceVisitAccessor = exports.WorkOrderStatusUpdateAccessor = exports.WorkOrderAccessor = exports.WayleaveAuditAccessor = exports.VoiceConfigurationAccessor = exports.VisitAccessor = exports.UserAccessor = exports.UgRetroAuditAccessor = exports.TransactionAccessor = exports.TimeSlotAccessor = exports.TeamAccessor = exports.SiteSpecificRiskAssessmentOutcomeFormAccessor = exports.ServiceAccessor = exports.ServiceAppointmentAccessor = exports.ServiceAppointmentConfigAccessor = exports.ScheduleSlotAccessor = void 0;
|
|
13
13
|
var AccountAccessor_1 = require("./AccountAccessor");
|
|
14
14
|
Object.defineProperty(exports, "AccountAccessor", { enumerable: true, get: function () { return AccountAccessor_1.AccountAccessor; } });
|
|
15
15
|
var ActivityLogAccessor_1 = require("./ActivityLogAccessor");
|
|
@@ -114,6 +114,8 @@ var ScheduleSlotAccessor_1 = require("./ScheduleSlotAccessor");
|
|
|
114
114
|
Object.defineProperty(exports, "ScheduleSlotAccessor", { enumerable: true, get: function () { return ScheduleSlotAccessor_1.ScheduleSlotAccessor; } });
|
|
115
115
|
var ServiceAppointmentConfigAccessor_1 = require("./ServiceAppointmentConfigAccessor");
|
|
116
116
|
Object.defineProperty(exports, "ServiceAppointmentConfigAccessor", { enumerable: true, get: function () { return ServiceAppointmentConfigAccessor_1.ServiceAppointmentConfigAccessor; } });
|
|
117
|
+
var ServiceAppointmentAccessor_1 = require("./ServiceAppointmentAccessor");
|
|
118
|
+
Object.defineProperty(exports, "ServiceAppointmentAccessor", { enumerable: true, get: function () { return ServiceAppointmentAccessor_1.ServiceAppointmentAccessor; } });
|
|
117
119
|
var ServiceAccessor_1 = require("./ServiceAccessor");
|
|
118
120
|
Object.defineProperty(exports, "ServiceAccessor", { enumerable: true, get: function () { return ServiceAccessor_1.ServiceAccessor; } });
|
|
119
121
|
var SiteSpecificRiskAssessmentOutcomeFormAccessor_1 = require("./SiteSpecificRiskAssessmentOutcomeFormAccessor");
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
2
|
+
export interface NewAppointmentProperties {
|
|
3
|
+
ExPolygonId: number;
|
|
4
|
+
Type: string;
|
|
5
|
+
ScheduleId: string;
|
|
6
|
+
Date: string;
|
|
7
|
+
TimeBlock: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class NewAppointmentDto extends OdinRecordCreateDto<NewAppointmentProperties> {
|
|
10
|
+
readonly actionName: string;
|
|
11
|
+
readonly schemaActionId: string;
|
|
12
|
+
readonly entity: string;
|
|
13
|
+
constructor(properties: NewAppointmentProperties, options?: {
|
|
14
|
+
journeyId?: string;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export interface NewAppointmentMessage extends OdinRecordCreatedEvent<NewAppointmentDto, NewAppointmentProperties> {
|
|
18
|
+
}
|
|
19
|
+
export declare const ROUTING_KEY_NEW_APPOINTMENT_CREATED = "NewAppointmentCreated";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ROUTING_KEY_NEW_APPOINTMENT_CREATED = exports.NewAppointmentDto = void 0;
|
|
4
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
5
|
+
class NewAppointmentDto extends core_1.OdinRecordCreateDto {
|
|
6
|
+
constructor(properties, options) {
|
|
7
|
+
super({
|
|
8
|
+
entity: 'FieldServiceModule:ServiceAppointment',
|
|
9
|
+
type: undefined,
|
|
10
|
+
properties,
|
|
11
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
12
|
+
});
|
|
13
|
+
this.actionName = 'NewAppointment';
|
|
14
|
+
this.schemaActionId = '8a5c0b54-7546-4fba-8863-736dd2c85434';
|
|
15
|
+
this.entity = 'FieldServiceModule:ServiceAppointment';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.NewAppointmentDto = NewAppointmentDto;
|
|
19
|
+
exports.ROUTING_KEY_NEW_APPOINTMENT_CREATED = 'NewAppointmentCreated';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServiceAppointment DB Accessor
|
|
3
|
+
*
|
|
4
|
+
* Provides typed access to ServiceAppointment records via direct database access.
|
|
5
|
+
* For use in backend services with principal + dbService.
|
|
6
|
+
* Returns wrapped records with typed action methods.
|
|
7
|
+
*
|
|
8
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
9
|
+
*/
|
|
10
|
+
import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
|
|
11
|
+
import { DbProvider } from '@d19n/odin-sdk-generator/dist/db.provider';
|
|
12
|
+
import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
|
|
13
|
+
import { ServiceAppointmentProperties } from '../entities-v2/ServiceAppointment';
|
|
14
|
+
import { ServiceAppointmentRecord } from '../records-v2/ServiceAppointmentRecord';
|
|
15
|
+
/** Search response with wrapped records */
|
|
16
|
+
export interface ServiceAppointmentDbSearchResponse {
|
|
17
|
+
records: ServiceAppointmentRecord[];
|
|
18
|
+
totalRecords: number;
|
|
19
|
+
hasMore: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class ServiceAppointmentDbAccessor {
|
|
22
|
+
private readonly _provider;
|
|
23
|
+
private readonly _moduleName;
|
|
24
|
+
private readonly _entityName;
|
|
25
|
+
constructor(principal: any, dbService: any);
|
|
26
|
+
get moduleName(): string;
|
|
27
|
+
get entityName(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get a single ServiceAppointment record by ID
|
|
30
|
+
*/
|
|
31
|
+
get(id: string): Promise<ServiceAppointmentRecord>;
|
|
32
|
+
/**
|
|
33
|
+
* Get multiple ServiceAppointment records by IDs
|
|
34
|
+
*/
|
|
35
|
+
getMany(ids: string[]): Promise<ServiceAppointmentRecord[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Search ServiceAppointment records
|
|
38
|
+
*/
|
|
39
|
+
search(params: Partial<OdinSearchV2>): Promise<ServiceAppointmentDbSearchResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Search all ServiceAppointment records with automatic pagination
|
|
42
|
+
*/
|
|
43
|
+
searchAll(params: Partial<OdinSearchV2>): Promise<ServiceAppointmentRecord[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Async generator for paginating through all matching records.
|
|
46
|
+
* Yields batches of wrapped records.
|
|
47
|
+
*/
|
|
48
|
+
paginate(params: Partial<OdinSearchV2>): AsyncGenerator<ServiceAppointmentRecord[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a fluent query builder for ServiceAppointment records
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const results = await accessor
|
|
55
|
+
* .query()
|
|
56
|
+
* .where('Status', 'in', ['Active', 'Pending'])
|
|
57
|
+
* .where('CreatedAt', 'gte', '2025-01-01')
|
|
58
|
+
* .select('id', 'title', 'properties.*')
|
|
59
|
+
* .sortBy('createdAt', 'desc')
|
|
60
|
+
* .limit(100)
|
|
61
|
+
* .execute();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
query(): QueryBuilder<ServiceAppointmentProperties, ServiceAppointmentRecord>;
|
|
65
|
+
/** Access the underlying DbProvider */
|
|
66
|
+
get provider(): DbProvider;
|
|
67
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ServiceAppointment DB Accessor
|
|
4
|
+
*
|
|
5
|
+
* Provides typed access to ServiceAppointment records via direct database access.
|
|
6
|
+
* For use in backend services with principal + dbService.
|
|
7
|
+
* Returns wrapped records with typed action methods.
|
|
8
|
+
*
|
|
9
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
10
|
+
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
21
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
22
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
23
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
24
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
26
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
27
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
28
|
+
function fulfill(value) { resume("next", value); }
|
|
29
|
+
function reject(value) { resume("throw", value); }
|
|
30
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.ServiceAppointmentDbAccessor = void 0;
|
|
34
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
35
|
+
const query_builder_1 = require("@d19n/odin-sdk-generator/dist/query-builder");
|
|
36
|
+
const ServiceAppointmentRecord_1 = require("../records-v2/ServiceAppointmentRecord");
|
|
37
|
+
class ServiceAppointmentDbAccessor {
|
|
38
|
+
constructor(principal, dbService) {
|
|
39
|
+
this._moduleName = 'FieldServiceModule';
|
|
40
|
+
this._entityName = 'ServiceAppointment';
|
|
41
|
+
this._provider = new db_provider_1.DbProvider(principal, dbService);
|
|
42
|
+
}
|
|
43
|
+
get moduleName() { return this._moduleName; }
|
|
44
|
+
get entityName() { return this._entityName; }
|
|
45
|
+
/**
|
|
46
|
+
* Get a single ServiceAppointment record by ID
|
|
47
|
+
*/
|
|
48
|
+
get(id) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const record = yield this._provider._getByPrimaryKey(this._moduleName, this._entityName, id);
|
|
51
|
+
return new ServiceAppointmentRecord_1.ServiceAppointmentRecord(record, this._provider);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get multiple ServiceAppointment records by IDs
|
|
56
|
+
*/
|
|
57
|
+
getMany(ids) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
if (ids.length === 0)
|
|
60
|
+
return [];
|
|
61
|
+
const records = yield this._provider._getManyByPrimaryKey(this._moduleName, this._entityName, ids);
|
|
62
|
+
return records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Search ServiceAppointment records
|
|
67
|
+
*/
|
|
68
|
+
search(params) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const result = yield this._provider._searchRecords(this._moduleName, this._entityName, params);
|
|
71
|
+
return {
|
|
72
|
+
records: result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider)),
|
|
73
|
+
totalRecords: result.totalRecords,
|
|
74
|
+
hasMore: result.hasMore,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Search all ServiceAppointment records with automatic pagination
|
|
80
|
+
*/
|
|
81
|
+
searchAll(params) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const result = yield this._provider._searchAllRecordsAndPaginate(this._moduleName, this._entityName, params);
|
|
84
|
+
return result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Async generator for paginating through all matching records.
|
|
89
|
+
* Yields batches of wrapped records.
|
|
90
|
+
*/
|
|
91
|
+
paginate(params) {
|
|
92
|
+
var _a;
|
|
93
|
+
return __asyncGenerator(this, arguments, function* paginate_1() {
|
|
94
|
+
let hasMore = true;
|
|
95
|
+
let searchAfter;
|
|
96
|
+
const query = Object.assign(Object.assign({}, params.query), { pageSize: ((_a = params.query) === null || _a === void 0 ? void 0 : _a.pageSize) || 500 });
|
|
97
|
+
while (hasMore) {
|
|
98
|
+
const result = yield __await(this._provider._searchRecords(this._moduleName, this._entityName, Object.assign(Object.assign({}, params), { query: Object.assign(Object.assign({}, query), { searchAfter }) })));
|
|
99
|
+
if (result.records.length > 0) {
|
|
100
|
+
yield yield __await(result.records.map((r) => new ServiceAppointmentRecord_1.ServiceAppointmentRecord(r, this._provider)));
|
|
101
|
+
const lastRecord = result.records[result.records.length - 1];
|
|
102
|
+
searchAfter = lastRecord === null || lastRecord === void 0 ? void 0 : lastRecord.sort;
|
|
103
|
+
}
|
|
104
|
+
hasMore = result.hasMore && result.records.length >= query.pageSize;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// ============================================
|
|
109
|
+
// QUERY BUILDER
|
|
110
|
+
// ============================================
|
|
111
|
+
/**
|
|
112
|
+
* Create a fluent query builder for ServiceAppointment records
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const results = await accessor
|
|
117
|
+
* .query()
|
|
118
|
+
* .where('Status', 'in', ['Active', 'Pending'])
|
|
119
|
+
* .where('CreatedAt', 'gte', '2025-01-01')
|
|
120
|
+
* .select('id', 'title', 'properties.*')
|
|
121
|
+
* .sortBy('createdAt', 'desc')
|
|
122
|
+
* .limit(100)
|
|
123
|
+
* .execute();
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
query() {
|
|
127
|
+
return (0, query_builder_1.createQueryBuilder)(this);
|
|
128
|
+
}
|
|
129
|
+
/** Access the underlying DbProvider */
|
|
130
|
+
get provider() {
|
|
131
|
+
return this._provider;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.ServiceAppointmentDbAccessor = ServiceAppointmentDbAccessor;
|
|
@@ -59,6 +59,7 @@ export { RemediationOutcomeFormDbAccessor, RemediationOutcomeFormDbSearchRespons
|
|
|
59
59
|
export { ReturnsDbAccessor, ReturnsDbSearchResponse } from './ReturnsDbAccessor';
|
|
60
60
|
export { ScheduleSlotDbAccessor, ScheduleSlotDbSearchResponse } from './ScheduleSlotDbAccessor';
|
|
61
61
|
export { ServiceAppointmentConfigDbAccessor, ServiceAppointmentConfigDbSearchResponse } from './ServiceAppointmentConfigDbAccessor';
|
|
62
|
+
export { ServiceAppointmentDbAccessor, ServiceAppointmentDbSearchResponse } from './ServiceAppointmentDbAccessor';
|
|
62
63
|
export { ServiceDbAccessor, ServiceDbSearchResponse } from './ServiceDbAccessor';
|
|
63
64
|
export { SiteSpecificRiskAssessmentOutcomeFormDbAccessor, SiteSpecificRiskAssessmentOutcomeFormDbSearchResponse } from './SiteSpecificRiskAssessmentOutcomeFormDbAccessor';
|
|
64
65
|
export { TeamDbAccessor, TeamDbSearchResponse } from './TeamDbAccessor';
|