@etainabl/nodejs-sdk 1.2.44 → 1.2.46

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 (154) hide show
  1. package/dist/index.d.cts +782 -0
  2. package/dist/index.d.ts +782 -0
  3. package/dist/index.js +626 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +588 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +28 -31
  8. package/.prettierrc +0 -11
  9. package/__tests__/reporting.test.ts +0 -88
  10. package/dist/cjs/api.d.ts +0 -111
  11. package/dist/cjs/api.js +0 -318
  12. package/dist/cjs/consumption.d.ts +0 -14
  13. package/dist/cjs/consumption.js +0 -32
  14. package/dist/cjs/db.d.ts +0 -6
  15. package/dist/cjs/db.js +0 -69
  16. package/dist/cjs/etainabl.d.ts +0 -10
  17. package/dist/cjs/etainabl.js +0 -2
  18. package/dist/cjs/index.d.ts +0 -10
  19. package/dist/cjs/index.js +0 -59
  20. package/dist/cjs/logger.d.ts +0 -3
  21. package/dist/cjs/logger.js +0 -14
  22. package/dist/cjs/monitoring.d.ts +0 -1
  23. package/dist/cjs/monitoring.js +0 -31
  24. package/dist/cjs/package.json +0 -3
  25. package/dist/cjs/reporting.d.ts +0 -2
  26. package/dist/cjs/reporting.js +0 -69
  27. package/dist/cjs/slack.d.ts +0 -4
  28. package/dist/cjs/slack.js +0 -28
  29. package/dist/cjs/types/account.d.ts +0 -112
  30. package/dist/cjs/types/account.js +0 -2
  31. package/dist/cjs/types/address.d.ts +0 -11
  32. package/dist/cjs/types/address.js +0 -2
  33. package/dist/cjs/types/asset.d.ts +0 -122
  34. package/dist/cjs/types/asset.js +0 -3
  35. package/dist/cjs/types/automation.d.ts +0 -33
  36. package/dist/cjs/types/automation.js +0 -2
  37. package/dist/cjs/types/company.d.ts +0 -42
  38. package/dist/cjs/types/company.js +0 -2
  39. package/dist/cjs/types/dataIngest.d.ts +0 -8
  40. package/dist/cjs/types/dataIngest.js +0 -2
  41. package/dist/cjs/types/email.d.ts +0 -18
  42. package/dist/cjs/types/email.js +0 -2
  43. package/dist/cjs/types/entity.d.ts +0 -16
  44. package/dist/cjs/types/entity.js +0 -2
  45. package/dist/cjs/types/index.d.ts +0 -19
  46. package/dist/cjs/types/index.js +0 -2
  47. package/dist/cjs/types/invoice.d.ts +0 -118
  48. package/dist/cjs/types/invoice.js +0 -2
  49. package/dist/cjs/types/log.d.ts +0 -10
  50. package/dist/cjs/types/log.js +0 -2
  51. package/dist/cjs/types/portal.d.ts +0 -8
  52. package/dist/cjs/types/portal.js +0 -2
  53. package/dist/cjs/types/reading.d.ts +0 -17
  54. package/dist/cjs/types/reading.js +0 -2
  55. package/dist/cjs/types/report.d.ts +0 -21
  56. package/dist/cjs/types/report.js +0 -2
  57. package/dist/cjs/types/scraperRun.d.ts +0 -15
  58. package/dist/cjs/types/scraperRun.js +0 -2
  59. package/dist/cjs/types/statusHistory.d.ts +0 -5
  60. package/dist/cjs/types/statusHistory.js +0 -2
  61. package/dist/cjs/types/supplier.d.ts +0 -28
  62. package/dist/cjs/types/supplier.js +0 -3
  63. package/dist/cjs/units.d.ts +0 -22
  64. package/dist/cjs/units.js +0 -94
  65. package/dist/mjs/api.d.ts +0 -111
  66. package/dist/mjs/api.js +0 -308
  67. package/dist/mjs/consumption.d.ts +0 -14
  68. package/dist/mjs/consumption.js +0 -22
  69. package/dist/mjs/db.d.ts +0 -6
  70. package/dist/mjs/db.js +0 -53
  71. package/dist/mjs/etainabl.d.ts +0 -10
  72. package/dist/mjs/etainabl.js +0 -1
  73. package/dist/mjs/index.d.ts +0 -10
  74. package/dist/mjs/index.js +0 -10
  75. package/dist/mjs/logger.d.ts +0 -3
  76. package/dist/mjs/logger.js +0 -9
  77. package/dist/mjs/monitoring.d.ts +0 -1
  78. package/dist/mjs/monitoring.js +0 -15
  79. package/dist/mjs/package.json +0 -3
  80. package/dist/mjs/reporting.d.ts +0 -2
  81. package/dist/mjs/reporting.js +0 -62
  82. package/dist/mjs/slack.d.ts +0 -4
  83. package/dist/mjs/slack.js +0 -14
  84. package/dist/mjs/types/account.d.ts +0 -112
  85. package/dist/mjs/types/account.js +0 -1
  86. package/dist/mjs/types/address.d.ts +0 -11
  87. package/dist/mjs/types/address.js +0 -1
  88. package/dist/mjs/types/asset.d.ts +0 -122
  89. package/dist/mjs/types/asset.js +0 -2
  90. package/dist/mjs/types/automation.d.ts +0 -33
  91. package/dist/mjs/types/automation.js +0 -1
  92. package/dist/mjs/types/company.d.ts +0 -42
  93. package/dist/mjs/types/company.js +0 -1
  94. package/dist/mjs/types/dataIngest.d.ts +0 -8
  95. package/dist/mjs/types/dataIngest.js +0 -1
  96. package/dist/mjs/types/email.d.ts +0 -18
  97. package/dist/mjs/types/email.js +0 -1
  98. package/dist/mjs/types/entity.d.ts +0 -16
  99. package/dist/mjs/types/entity.js +0 -1
  100. package/dist/mjs/types/index.d.ts +0 -19
  101. package/dist/mjs/types/index.js +0 -1
  102. package/dist/mjs/types/invoice.d.ts +0 -118
  103. package/dist/mjs/types/invoice.js +0 -1
  104. package/dist/mjs/types/log.d.ts +0 -10
  105. package/dist/mjs/types/log.js +0 -1
  106. package/dist/mjs/types/portal.d.ts +0 -8
  107. package/dist/mjs/types/portal.js +0 -1
  108. package/dist/mjs/types/reading.d.ts +0 -17
  109. package/dist/mjs/types/reading.js +0 -1
  110. package/dist/mjs/types/report.d.ts +0 -21
  111. package/dist/mjs/types/report.js +0 -1
  112. package/dist/mjs/types/scraperRun.d.ts +0 -15
  113. package/dist/mjs/types/scraperRun.js +0 -1
  114. package/dist/mjs/types/statusHistory.d.ts +0 -5
  115. package/dist/mjs/types/statusHistory.js +0 -1
  116. package/dist/mjs/types/supplier.d.ts +0 -28
  117. package/dist/mjs/types/supplier.js +0 -2
  118. package/dist/mjs/units.d.ts +0 -22
  119. package/dist/mjs/units.js +0 -89
  120. package/eslint.config.js +0 -60
  121. package/fixup.sh +0 -11
  122. package/src/api.ts +0 -382
  123. package/src/consumption.ts +0 -40
  124. package/src/db.ts +0 -69
  125. package/src/etainabl.ts +0 -10
  126. package/src/index.ts +0 -21
  127. package/src/logger.ts +0 -13
  128. package/src/monitoring.ts +0 -18
  129. package/src/reporting.ts +0 -78
  130. package/src/slack.ts +0 -16
  131. package/src/types/account.ts +0 -116
  132. package/src/types/address.ts +0 -12
  133. package/src/types/asset.ts +0 -142
  134. package/src/types/automation.ts +0 -35
  135. package/src/types/company.ts +0 -47
  136. package/src/types/dataIngest.ts +0 -8
  137. package/src/types/email.ts +0 -18
  138. package/src/types/entity.ts +0 -17
  139. package/src/types/index.ts +0 -20
  140. package/src/types/invoice.ts +0 -119
  141. package/src/types/log.ts +0 -10
  142. package/src/types/portal.ts +0 -9
  143. package/src/types/reading.ts +0 -17
  144. package/src/types/report.ts +0 -21
  145. package/src/types/scraperRun.ts +0 -15
  146. package/src/types/statusHistory.ts +0 -5
  147. package/src/types/supplier.ts +0 -31
  148. package/src/units.ts +0 -111
  149. package/tsconfig.base.json +0 -31
  150. package/tsconfig.cjs.json +0 -8
  151. package/tsconfig.json +0 -9
  152. package/tsconfig.test.json +0 -13
  153. package/vitest.config.js +0 -10
  154. package/vitest.workspace.js +0 -5
@@ -1,4 +0,0 @@
1
- declare const _default: {
2
- postMessage: (message: string) => Promise<import("axios").AxiosResponse<any, any>>;
3
- };
4
- export default _default;
package/dist/cjs/slack.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const postMessage = (message) => __awaiter(void 0, void 0, void 0, function* () {
17
- const url = 'https://hooks.slack.com/services/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';
18
- const data = {
19
- text: `[${(process.env.ENV || '').toUpperCase()}][${process.env.AWS_LAMBDA_FUNCTION_NAME}] ${message}`
20
- };
21
- const headers = {
22
- 'Content-Type': 'application/json'
23
- };
24
- return axios_1.default.post(url, data, { headers });
25
- });
26
- exports.default = {
27
- postMessage
28
- };
@@ -1,112 +0,0 @@
1
- import type { Portal } from './portal.js';
2
- import type { StatusHistory } from './statusHistory.js';
3
- interface PortalAccountSchema extends Portal {
4
- invoiceFilenames: any[];
5
- }
6
- interface RateSchema {
7
- type: string;
8
- value: number;
9
- description: string;
10
- }
11
- interface ContractSchema {
12
- startDate: Date;
13
- endDate: Date;
14
- terminationDate?: Date;
15
- paymentTerms?: string;
16
- duration?: string;
17
- tariffName?: string;
18
- contractConsumption?: number;
19
- volumeTolerance?: any[];
20
- renewablePercentage?: number;
21
- marketBasedEmissionFactor?: number;
22
- chargeableCclPercentage?: number;
23
- commissionRates?: number;
24
- rates: any[];
25
- s3Key?: string;
26
- rateTypeMapping?: object;
27
- batchId?: string;
28
- supplierId?: string;
29
- status: 'active' | 'inactive';
30
- userSub?: string;
31
- deletedOn?: Date;
32
- }
33
- interface CreditNoteSchema {
34
- name: string;
35
- type: string;
36
- amount: number;
37
- netAmount: number;
38
- taxAmount: number;
39
- date: Date;
40
- isPaid: boolean;
41
- s3Key: string;
42
- stampedS3Key: string;
43
- fileName: string;
44
- invoiceData: object;
45
- userSub: string;
46
- readingIds: any[];
47
- supplierId: string;
48
- totalUnits: number;
49
- endDate: Date;
50
- startDate: Date;
51
- stampDate: Date;
52
- totalWaterVolume: number;
53
- totalWasteVolume: number;
54
- totalWaterCost: number;
55
- totalWasteCost: number;
56
- }
57
- export interface Account {
58
- _id: string;
59
- name: string;
60
- modifiedBy?: string;
61
- siteCode?: string;
62
- type: 'gas' | 'electricity' | 'water' | 'waste' | 'solar';
63
- supplierRef?: string;
64
- financialCode?: string;
65
- propertyCode?: string;
66
- meterPointNumber?: string;
67
- meterSerialNumber?: string;
68
- meterPointNumber2?: string;
69
- meterUnits: 'kwh' | 'm3' | 'ft3';
70
- automaticMeterRead?: boolean;
71
- status?: 'active' | 'inactive';
72
- statusHistory?: StatusHistory[];
73
- rates?: RateSchema[];
74
- capacity?: string;
75
- meterOperator?: string;
76
- meterLocation?: string;
77
- meterOperatorType?: 'lease' | 'purchase';
78
- meterOperatorExpiryDate?: Date;
79
- dataCollector?: string;
80
- parentAccountId?: string;
81
- processingInvoices?: object[];
82
- contracts?: ContractSchema[];
83
- creditNotes?: CreditNoteSchema[];
84
- meterUser?: string;
85
- isTrc?: boolean;
86
- floorArea?: string;
87
- floorAreaUnit?: 'metric' | 'imperial';
88
- reportingType?: string;
89
- solarType?: 'generation' | 'export';
90
- consumptionSource?: 'primary' | 'sub' | 'primary-sub';
91
- esec?: 'a' | 'b' | 'c' | 'd' | 'e' | 'g' | 'h' | 'j' | 'k' | 'l' | 'm' | 'n' | 'p' | 'q' | 'r' | 's' | 't' | 'u';
92
- portal?: PortalAccountSchema;
93
- deviceId?: string;
94
- gridfetchLoa?: {
95
- s3Key?: string;
96
- name?: string;
97
- uploadedBy?: string;
98
- uploadedAt?: Date;
99
- expiryDate?: Date;
100
- error?: string;
101
- uploaded?: boolean;
102
- };
103
- automationIds?: string[];
104
- customIntegrations?: object;
105
- supplierId?: string;
106
- batchId?: string;
107
- assetId: string;
108
- entityId: string;
109
- companyId: string;
110
- userSub: string;
111
- }
112
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- export interface Address {
2
- streetAddress: string;
3
- locality?: string;
4
- region?: string;
5
- postCode: string;
6
- province?: string;
7
- countryCode?: string;
8
- jurisdictionCode?: string;
9
- latitude?: string;
10
- longitude?: string;
11
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,122 +0,0 @@
1
- import type { Address } from './address.js';
2
- import type { StatusHistory } from './statusHistory.js';
3
- interface Image {
4
- url?: string;
5
- label?: string;
6
- type?: string;
7
- isHidden?: boolean;
8
- isPrimary?: boolean;
9
- }
10
- interface FloodRisk {
11
- url?: string;
12
- description?: string;
13
- label?: string;
14
- latitude?: number;
15
- longitude?: number;
16
- fetchedAt?: Date;
17
- }
18
- interface Crime {
19
- category?: string;
20
- month?: string;
21
- crimeId?: string;
22
- outcomeCategory?: string;
23
- outcomeDate?: string;
24
- location?: {
25
- latitude: string;
26
- longitude: string;
27
- street: string;
28
- };
29
- fetchedAt?: Date;
30
- }
31
- interface AirQuality {
32
- index?: number;
33
- indexColour?: string;
34
- indexRating?: string;
35
- details?: object;
36
- location?: object;
37
- lastMeasured?: Date;
38
- fetchedAt?: Date;
39
- }
40
- interface Benchmark {
41
- benchmarkId: string;
42
- fieldCode: string;
43
- fieldValue: string;
44
- }
45
- interface Document {
46
- s3Key?: string;
47
- name: string;
48
- extension?: string;
49
- type: string;
50
- status: string;
51
- score?: string;
52
- providerId?: string;
53
- providerData?: object;
54
- certificate?: object;
55
- createdAt: Date;
56
- accountIds?: string[];
57
- }
58
- interface TimelineEvent {
59
- date: Date;
60
- title: string;
61
- status: string;
62
- content?: string;
63
- icon?: string;
64
- accountIds?: string[];
65
- }
66
- interface AssetRecommendation {
67
- recommendationId: string;
68
- documentIds?: string[];
69
- }
70
- interface AssetSettings {
71
- consumptionSources: {
72
- electricity: string;
73
- solar: string;
74
- gas: string;
75
- water: string;
76
- };
77
- }
78
- export interface Asset {
79
- _id: string;
80
- siteName: string;
81
- address: Address;
82
- assetType: string;
83
- floorArea: number;
84
- floorAreaUnit: 'metric' | 'imperial';
85
- noOfFloors?: number;
86
- energyRating: string;
87
- gav: string;
88
- gavCurrency: string;
89
- currency: string;
90
- occupationStatus: 'occupied' | 'vacant' | 'other' | 'n/a';
91
- type: 'new construction' | 'major renovation' | 'standing investment' | 'n/a';
92
- vacancyRate?: number;
93
- constructionYear?: number;
94
- ownedSince?: Date;
95
- disposalDate?: Date;
96
- tenure: 'freehold' | 'leasehold';
97
- tenantControlledPercent?: number;
98
- landlordControlledPercent?: number;
99
- occupancyLevel?: number;
100
- images: Image[];
101
- pricePaid?: number;
102
- floodRisks: FloodRisk[];
103
- recentCrimes: Crime[];
104
- recentAirQuality: AirQuality;
105
- documents?: Document[];
106
- epbCertificates: any[];
107
- status?: string;
108
- settings: AssetSettings;
109
- recommendations?: AssetRecommendation[];
110
- statusHistory: StatusHistory[];
111
- timelineEvents: TimelineEvent[];
112
- benchmarks: Benchmark[];
113
- lastPopulated?: Date;
114
- deletedOn?: Date;
115
- batchId?: string;
116
- companyId: string;
117
- entityId: string;
118
- assetGroupIds: string[];
119
- userSub: string;
120
- gresbId?: string;
121
- }
122
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -1,33 +0,0 @@
1
- interface Log {
2
- message: string;
3
- timestamp: Date;
4
- batchId?: string;
5
- source?: string;
6
- }
7
- interface LastCollection {
8
- collectedAt: Date | null;
9
- data: Record<string, any> | null;
10
- error: Record<string, any> | null;
11
- status: 'success' | 'error' | 'pending';
12
- source: Record<string, any> | null;
13
- }
14
- type FrequencyType = 'never' | 'trigger' | 'hourly' | 'daily' | 'weekly' | 'monthly';
15
- export interface Automation {
16
- _id: string;
17
- description?: string;
18
- service: string;
19
- source: string;
20
- category: string;
21
- active: boolean;
22
- status?: 'running' | 'pending';
23
- lastCollection: LastCollection;
24
- logs: Log[];
25
- data: Record<string, any>;
26
- sourceData: Record<string, any>;
27
- frequency?: FrequencyType;
28
- accountIds?: string[];
29
- assetIds?: string[];
30
- userSub: string;
31
- companyId: string;
32
- }
33
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,42 +0,0 @@
1
- import { Address } from './address.js';
2
- import { Portal } from './portal.js';
3
- interface SupplierPortals {
4
- supplierId: string;
5
- portal: Portal;
6
- }
7
- interface CustomIntegrations {
8
- account: any[];
9
- asset: any[];
10
- entity: any[];
11
- }
12
- interface DefaultSources {
13
- electricity: 'invoice' | 'consumption' | 'reading';
14
- solar: 'invoice' | 'consumption' | 'reading';
15
- gas: 'invoice' | 'consumption' | 'reading';
16
- water: 'invoice' | 'consumption' | 'reading';
17
- }
18
- interface CompanySettings {
19
- showLogo?: boolean;
20
- invoiceCategories?: any[];
21
- miscInvoiceCategories?: any[];
22
- messageCategories?: any[];
23
- documentCategories?: any[];
24
- assetDataSchemas?: any[];
25
- hideCostData?: boolean;
26
- calendarPeriod?: string;
27
- customIntegrations?: CustomIntegrations;
28
- supplierPortals?: SupplierPortals[];
29
- defaultSources?: DefaultSources;
30
- scraperCounter?: number;
31
- }
32
- export interface Company {
33
- _id: string;
34
- name: string;
35
- address?: Address;
36
- invoiceEmail?: string;
37
- users?: string[];
38
- settings: CompanySettings;
39
- logoS3Key: string;
40
- logoUrl?: string;
41
- }
42
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- export interface DataIngest {
2
- _id: string;
3
- messageId: string;
4
- status: 'started' | 'processing' | 'importing' | 'completed' | 'failed' | 'dlq';
5
- context: any;
6
- startTime: string;
7
- remainingTime: number;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +0,0 @@
1
- interface Attachment {
2
- filename: string;
3
- s3Key: string;
4
- }
5
- export interface Email {
6
- _id: string;
7
- destinations: string[];
8
- service: string;
9
- subject: string;
10
- body: string;
11
- from: string;
12
- attachments?: Attachment[];
13
- sesMessageId: string;
14
- s3Key: string;
15
- userSub?: string;
16
- companyId?: string;
17
- }
18
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +0,0 @@
1
- import { Address } from './address.js';
2
- type EntityType = 'fund' | 'company' | 'charity' | 'school/university' | 'council' | 'other';
3
- export interface Entity {
4
- _id: string;
5
- legalName: string;
6
- type: EntityType;
7
- companyNumber?: string;
8
- companyLogo?: string;
9
- billingAddress: Address;
10
- parentEntityId?: string;
11
- ultimateParentEntityId?: string;
12
- companyId: string;
13
- batchId?: string;
14
- userSub: string;
15
- }
16
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- export type { Account } from './account.js';
2
- export type { Asset } from './asset.js';
3
- export type { Automation } from './automation.js';
4
- export type { Company } from './company.js';
5
- export type { CreateScraperRunParams, ScraperRun } from './scraperRun.js';
6
- export type { DataIngest } from './dataIngest.js';
7
- export type { Entity } from './entity.js';
8
- export type { Email } from './email.js';
9
- export type { Invoice } from './invoice.js';
10
- export type { Log } from './log.js';
11
- export type { Reading } from './reading.js';
12
- export type { Report } from './report.js';
13
- export type { Supplier } from './supplier.js';
14
- export interface ETNPagedResponse<T = any> {
15
- data: T[];
16
- total: number;
17
- limit: number;
18
- skip: number;
19
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,118 +0,0 @@
1
- interface Values {
2
- friendlyInvoiceNumber?: string;
3
- friendlySupplierRef?: string;
4
- friendlyStartDate?: string;
5
- friendlyEndDate?: string;
6
- friendlyInvoiceDate?: string;
7
- friendlyMeterPointNumber?: string;
8
- friendlyMeterPointNumber2?: string;
9
- friendlyMeterSerialNumber?: string;
10
- friendlyPipeSize?: string;
11
- friendlyTotalUnitCost?: number;
12
- friendlyTotalWaterCost?: number;
13
- friendlyTotalWasteCost?: number;
14
- friendlyTotalDaily?: number;
15
- friendlyTotalLevy?: number;
16
- friendlyTotalKva?: number;
17
- friendlyTotalUnits?: number;
18
- friendlyTotalWaterVolume?: number;
19
- friendlyTotalWasteVolume?: number;
20
- friendlyNetTotalCost?: number;
21
- friendlyTotalTax?: number;
22
- friendlyTotalCost?: number;
23
- friendlyMeteredConsumption?: string;
24
- friendlyCorrectedConsumption?: string;
25
- friendlyCorrectionFactor?: string;
26
- friendlyCalorificValue?: string;
27
- friendlyReadFactor?: string;
28
- friendlyType?: string;
29
- friendlyStartRead?: string;
30
- friendlyEndRead?: string;
31
- invoiceNumber?: string;
32
- supplierRef?: string;
33
- startDate?: Date;
34
- endDate?: Date;
35
- invoiceDate?: Date;
36
- meterPointNumber?: string;
37
- meterPointNumber2?: string;
38
- meterSerialNumber?: string;
39
- pipeSize?: string;
40
- totalUnitCost?: number;
41
- totalWaterCost?: number;
42
- totalWasteCost?: number;
43
- totalDaily?: number;
44
- totalLevy?: number;
45
- totalKva?: number;
46
- totalUnits?: number;
47
- totalWaterVolume?: number;
48
- totalWasteVolume?: number;
49
- netTotalCost?: number;
50
- totalTax?: number;
51
- totalCost?: number;
52
- meteredConsumption?: string;
53
- correctedConsumption?: string;
54
- correctionFactor?: string;
55
- calorificValue?: string;
56
- readFactor?: string;
57
- type?: string;
58
- startRead?: string;
59
- endRead?: string;
60
- }
61
- interface Rate {
62
- consumption?: string;
63
- cost?: string;
64
- endDate?: Date | null;
65
- endRead?: string | null;
66
- endReadType?: string | null;
67
- rateName?: string | null;
68
- startDate?: Date | null;
69
- startRead?: string | null;
70
- startReadType?: string | null;
71
- type: RateType | null;
72
- unitRate?: string | null;
73
- }
74
- type InvoiceStatus = 'processing' | 'pending' | 'uploading' | 'queued' | 'captured' | 'error' | 'completed';
75
- type FinancialStatus = 'approved' | 'new' | 'not-approved' | 'paid' | 'sent-for-payment';
76
- type RateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount';
77
- export interface Invoice {
78
- _id: string;
79
- jobId?: string | null;
80
- startTime?: Date;
81
- endTime?: Date | null;
82
- s3Key: string;
83
- s3TextractKey?: string | null;
84
- stampedS3Key: string | null;
85
- fileName?: string | null;
86
- status: InvoiceStatus;
87
- financialStatus: FinancialStatus;
88
- completed?: boolean;
89
- type?: string | null;
90
- tags?: string[];
91
- manualResults?: Record<string, any>;
92
- values?: Values;
93
- rates?: Rate[];
94
- detailedResults?: Record<string, any>;
95
- templateVersion?: string | null;
96
- error?: Record<string, any>;
97
- isPaid?: boolean;
98
- isCreditNote?: boolean;
99
- isConvertedCreditNote?: boolean;
100
- isManual?: boolean;
101
- uploaderStatus?: string;
102
- simulated?: boolean;
103
- notes?: string | null;
104
- assignedTo?: string;
105
- noScrape?: boolean;
106
- scraperInvoiceId?: string;
107
- confirmedAt?: Date | null;
108
- confirmedBy?: string | null;
109
- supplierId?: string | null;
110
- sisterId?: string | null;
111
- batchId?: string | null;
112
- accountId?: string | null;
113
- entityId?: string;
114
- companyId: string;
115
- userSub: string;
116
- validation?: any[];
117
- }
118
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- export interface Log {
2
- _id: string;
3
- message: string;
4
- context?: {};
5
- linkedId?: string;
6
- linkedType?: string;
7
- type: string;
8
- userSub?: string;
9
- companyId?: string;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- export interface Portal {
2
- username?: string;
3
- password?: string;
4
- scraperEnabled?: boolean;
5
- url?: string;
6
- scraperId?: string;
7
- scraperStartDate?: Date;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- export interface Reading {
2
- _id: string;
3
- submittedAt: Date;
4
- value: number;
5
- type?: string;
6
- invoiceStartRead?: number;
7
- source: string;
8
- invoiceId?: string;
9
- rateId?: string;
10
- contractRateType?: string;
11
- invoiceBatchId?: string;
12
- batchId?: string;
13
- accountId: string;
14
- entityId: string;
15
- companyId: string;
16
- userSub?: string;
17
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- export interface Report {
2
- _id: string;
3
- type: 'dynamic' | 'spreadsheet' | 'table' | 'pdf';
4
- subType?: string;
5
- fileFormat: 'pdf' | 'xlsx' | 'csv' | 'png' | 'jpg' | 'chart';
6
- fileName?: string;
7
- status: 'preparing' | 'ready';
8
- scheduled?: boolean;
9
- version?: number;
10
- metadata?: Record<string, any>;
11
- data?: Record<string, any>;
12
- requestedAt: Date;
13
- availableAt?: Date;
14
- s3Key: string | null;
15
- batchId?: string;
16
- scheduledReportId?: string;
17
- reportTemplateId?: string;
18
- entityId: string;
19
- companyId: string;
20
- userSub?: string;
21
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
1
- export interface CreateScraperRunParams {
2
- supplierId: string;
3
- accountId: string;
4
- companyId: string;
5
- }
6
- export interface ScraperRun {
7
- _id: string;
8
- logs?: {}[];
9
- supplierId: string;
10
- accountId: string;
11
- companyId: string;
12
- invoiceData?: [];
13
- status: string[];
14
- error?: string;
15
- }