@jsb188/mday 1.1.10 → 1.1.12
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/package.json +140 -54
- package/src/constants/agentMemory.ts +123 -0
- package/src/constants/agentNote.ts +212 -0
- package/src/constants/aiChat.ts +10 -0
- package/src/constants/billing.ts +126 -0
- package/src/constants/campaign.ts +236 -0
- package/src/constants/contact.ts +72 -0
- package/src/constants/csvExport.ts +133 -0
- package/src/constants/dataTable.ts +21 -21
- package/src/constants/dataTableFieldTypes.generated.ts +59 -0
- package/src/constants/docAccess.ts +33 -0
- package/src/constants/dt.ts +234 -0
- package/src/constants/email.ts +125 -7
- package/src/constants/fieldDoc.ts +104 -0
- package/src/constants/graphqlReactivity.ts +196 -0
- package/src/constants/integration.ts +8 -9
- package/src/constants/log.ts +14 -408
- package/src/constants/logDisplay/README.md +88 -0
- package/src/constants/logDisplay/defaults.ts +39 -0
- package/src/constants/logDisplay/index.ts +27 -0
- package/src/constants/logDisplay/operations/arable.ts +16 -0
- package/src/constants/logDisplay/operations/farmersMarket.ts +10 -0
- package/src/constants/logDisplay/operations/foodManufacturing.ts +13 -0
- package/src/constants/logDisplay/shared/accounting.ts +13 -0
- package/src/constants/logDisplay/shared/interactions.ts +13 -0
- package/src/constants/logDisplay/shared/rackTemperatures.ts +42 -0
- package/src/constants/logTaxonomy.generated.ts +2207 -0
- package/src/constants/noteDoc.ts +77 -0
- package/src/constants/organization.ts +18 -21
- package/src/constants/pageRoute.ts +23 -0
- package/src/constants/qrCode.ts +30 -0
- package/src/constants/sheet.ts +126 -14
- package/src/constants/sms.ts +18 -0
- package/src/constants/square.ts +6 -6
- package/src/constants/storage.ts +80 -7
- package/src/constants/usage.ts +82 -0
- package/src/constants/workflowSteps.ts +60 -0
- package/src/schemas/editLogEntry.ts +836 -780
- package/src/schemas/inboundContact.ts +60 -55
- package/src/schemas/logsQuery.ts +55 -49
- package/src/types/account.d.ts +4 -1
- package/src/types/agentMemory.d.ts +98 -0
- package/src/types/agentNote.d.ts +443 -0
- package/src/types/billing.d.ts +537 -0
- package/src/types/campaign.d.ts +1533 -0
- package/src/types/contact.d.ts +15 -0
- package/src/types/csvExport.d.ts +213 -0
- package/src/types/dataAnalysis.d.ts +44 -0
- package/src/types/dataTable.d.ts +115 -403
- package/src/types/definitionElement.d.ts +35 -0
- package/src/types/docAccess.d.ts +96 -0
- package/src/types/dt.d.ts +257 -0
- package/src/types/email.d.ts +184 -24
- package/src/types/emailReplyReport.d.ts +76 -0
- package/src/types/fieldDoc.d.ts +702 -0
- package/src/types/fieldDocContract.d.ts +90 -0
- package/src/types/inboundContact.d.ts +10 -1
- package/src/types/log.d.ts +254 -295
- package/src/types/logDisplay.types.ts +85 -0
- package/src/types/organization.d.ts +91 -43
- package/src/types/pageRoute.d.ts +48 -0
- package/src/types/qrCode.d.ts +96 -0
- package/src/types/richText.d.ts +81 -0
- package/src/types/sheet.d.ts +678 -129
- package/src/types/sms.d.ts +38 -0
- package/src/types/storage.d.ts +449 -129
- package/src/types/usage.d.ts +106 -0
- package/src/types/workflow.d.ts +315 -54
- package/src/utils/agentMemory.ts +15 -0
- package/src/utils/agentNote.ts +850 -0
- package/src/utils/aiChat.ts +43 -0
- package/src/utils/aiChatWork.ts +64 -0
- package/src/utils/billing.ts +37 -0
- package/src/utils/campaign.ts +1174 -0
- package/src/utils/campaignAI.ts +72 -0
- package/src/utils/campaignAccess.ts +239 -0
- package/src/utils/campaignEmail.ts +601 -0
- package/src/utils/campaignEmailCompiler.ts +372 -0
- package/src/utils/campaignEmailImages.ts +60 -0
- package/src/utils/campaignEmailStyles.ts +544 -0
- package/src/utils/campaignLifecycle.ts +104 -0
- package/src/utils/campaignPreview.ts +285 -0
- package/src/utils/contact.ts +50 -0
- package/src/utils/csvExport.ts +19 -0
- package/src/utils/dataTable.ts +95 -618
- package/src/utils/dataTableFieldTypeRegistry.ts +106 -0
- package/src/utils/dataTableRelativeDate.ts +447 -0
- package/src/utils/definitionElement.ts +84 -0
- package/src/utils/docAccess.ts +383 -0
- package/src/utils/documentName.ts +53 -0
- package/src/utils/email.ts +317 -51
- package/src/utils/emailReplyReport.test.ts +187 -0
- package/src/utils/emailReplyReport.ts +143 -0
- package/src/utils/fieldDoc.ts +157 -0
- package/src/utils/fieldDocAnswers.ts +128 -0
- package/src/utils/fieldDocDefaults.ts +36 -0
- package/src/utils/fieldDocProgram.ts +36 -0
- package/src/utils/fieldDocSummary.ts +30 -0
- package/src/utils/log.ts +276 -192
- package/src/utils/logDisplay.helpers.ts +177 -0
- package/src/utils/logDisplay.ts +87 -0
- package/src/utils/logRegistryValue.ts +90 -0
- package/src/utils/logStoreRead.ts +262 -0
- package/src/utils/logTaxonomy.helpers.ts +17 -0
- package/src/utils/logTaxonomy.ts +76 -0
- package/src/utils/logTaxonomyDisplay.ts +395 -0
- package/src/utils/noteDoc.ts +609 -0
- package/src/utils/organization.ts +337 -84
- package/src/utils/pageRoute.ts +71 -0
- package/src/utils/qrCode.helpers.ts +189 -0
- package/src/utils/qrCode.test.ts +519 -0
- package/src/utils/qrCode.ts +273 -0
- package/src/utils/richTextHTML.ts +385 -0
- package/src/utils/sheet.ts +199 -107
- package/src/utils/sheetAxisMove.ts +616 -0
- package/src/utils/sheetBootstrap.ts +1402 -0
- package/src/utils/sheetCellLiteral.ts +101 -0
- package/src/utils/sheetCommand.ts +358 -0
- package/src/utils/sheetDesign.ts +705 -0
- package/src/utils/sheetExport.ts +186 -0
- package/src/utils/sheetFeatureReference.ts +183 -0
- package/src/utils/sheetFormulaArgs.ts +168 -0
- package/src/utils/sheetFormulaCompile.ts +475 -0
- package/src/utils/sheetFormulaConditionalAggregate.ts +254 -0
- package/src/utils/sheetFormulaCriteria.ts +656 -0
- package/src/utils/sheetFormulaDate.ts +444 -0
- package/src/utils/sheetFormulaEvaluation.ts +899 -0
- package/src/utils/sheetFormulaEvaluator.ts +997 -0
- package/src/utils/sheetFormulaFunctionHandlers.ts +403 -0
- package/src/utils/sheetFormulaLogical.ts +116 -0
- package/src/utils/sheetFormulaLookup.ts +488 -0
- package/src/utils/sheetFormulaMath.ts +48 -0
- package/src/utils/sheetFormulaParser.ts +729 -0
- package/src/utils/sheetFormulaRange.ts +330 -0
- package/src/utils/sheetFormulaReference.ts +703 -0
- package/src/utils/sheetFormulaReferenceAggregates.ts +313 -0
- package/src/utils/sheetFormulaReferenceDates.ts +237 -0
- package/src/utils/sheetFormulaReferenceLogical.ts +330 -0
- package/src/utils/sheetFormulaReferenceLookup.ts +341 -0
- package/src/utils/sheetFormulaReferenceMath.ts +95 -0
- package/src/utils/sheetFormulaReferenceRewrite.ts +220 -0
- package/src/utils/sheetFormulaReferenceText.ts +462 -0
- package/src/utils/sheetFormulaSyntax.ts +1027 -0
- package/src/utils/sheetFormulaText.ts +430 -0
- package/src/utils/sheetJournal.ts +200 -0
- package/src/utils/sheetNumberFormat.ts +1012 -0
- package/src/utils/sheetPreview.ts +68 -0
- package/src/utils/sheetSequence.ts +118 -0
- package/src/utils/sheetSnapshot.ts +739 -0
- package/src/utils/sheetStructureEdit.ts +914 -0
- package/src/utils/sheetStructureReferences.ts +389 -0
- package/src/utils/square.ts +22 -12
- package/src/utils/storage.ts +198 -0
- package/src/utils/table-route.ts +127 -11
- package/src/utils/time.ts +12 -0
- package/src/utils/workflow.ts +334 -40
- package/src/utils/workflowLogFingerprint.ts +302 -0
- package/src/utils/workflowLogRevisionSnapshot.ts +424 -0
- package/src/utils/workflowProgress.ts +280 -0
- package/src/utils/workflowTriggers.ts +61 -0
- package/tests/agentNote.test.ts +395 -0
- package/tests/campaignAI.test.ts +119 -0
- package/tests/campaignAccess.test.ts +239 -0
- package/tests/campaignEmail.test.ts +441 -0
- package/tests/campaignLifecycle.test.ts +134 -0
- package/tests/campaignPublication.test.ts +309 -0
- package/tests/dataTableFieldTypeRegistry.test.ts +111 -0
- package/tests/dataTableRelativeDate.test.ts +412 -0
- package/tests/docAccess.test.ts +525 -0
- package/tests/editLogEntry.test.ts +112 -0
- package/tests/email.test.ts +39 -0
- package/tests/fieldDocProgram.test.ts +114 -0
- package/tests/logDisplay.fixtures.ts +67 -0
- package/tests/logDisplay.test.ts +227 -0
- package/tests/noteDoc.test.ts +514 -0
- package/tests/richTextHTML.test.ts +185 -0
- package/tests/sheetAxisMove.test.ts +352 -0
- package/tests/sheetBootstrap.test.ts +1967 -0
- package/tests/sheetFeatureReference.test.ts +22 -0
- package/tests/sheetFormulaCriteria.test.ts +269 -0
- package/tests/sheetFormulaEvaluator.test.ts +468 -0
- package/tests/sheetFormulaFunctions.test.ts +538 -0
- package/tests/sheetFormulaLanguage.test.ts +361 -0
- package/tests/sheetFormulaParity.fixtures.ts +872 -0
- package/tests/sheetFormulaParity.test.ts +188 -0
- package/tests/sheetFormulaRange.test.ts +167 -0
- package/tests/sheetFormulaReference.test.ts +78 -0
- package/tests/sheetFormulaReferenceRewrite.test.ts +117 -0
- package/tests/sheetFormulaTextDate.test.ts +512 -0
- package/tests/sheetSequence.test.ts +22 -0
- package/tests/sheetSnapshot.test.ts +134 -0
- package/tests/sheetStructureEdit.test.ts +537 -0
- package/tests/sheetStructureReferences.test.ts +589 -0
- package/tests/workflowLifecycleStatus.test.ts +60 -0
- package/tests/workflowLogFingerprint.test.ts +203 -0
- package/tests/workflowLogRevisionSnapshot.test.ts +96 -0
- package/tests/workflowProgress.test.ts +180 -0
- package/tests/workflowTriggers.test.ts +29 -0
- package/tsconfig.json +10 -10
- package/vitest.config.ts +8 -0
- package/src/constants/log-activityTexts.ts +0 -235
- package/src/constants/product.ts +0 -42
- package/src/constants/report.ts +0 -44
- package/src/schemas/organization.ts +0 -65
- package/src/schemas/productsQuery.ts +0 -53
- package/src/schemas/reportsQuery.ts +0 -20
- package/src/types/product.d.ts +0 -84
- package/src/types/report.d.ts +0 -290
- package/src/utils/product-calEvent.ts +0 -455
- package/src/utils/report.ts +0 -158
package/src/types/log.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { REQUEST_SOURCE_ENUMS } from '@jsb188/app/constants/agent.ts';
|
|
2
2
|
import type { LabelAndValue } from '@jsb188/app/types/other.d.ts';
|
|
3
|
-
import {
|
|
4
|
-
LOG_ARABLE_ACTIVITY_ENUMS,
|
|
5
|
-
LOG_FARMERS_MARKET_ACTIVITY_ENUMS,
|
|
6
|
-
LOG_GROWER_NETWORK_ACTIVITY_ENUMS,
|
|
7
|
-
LOG_LIVESTOCK_ACTIVITY_ENUMS,
|
|
8
|
-
LOG_SORT_ENUMS
|
|
9
|
-
} from '../constants/log.ts';
|
|
3
|
+
import { LOG_SORT_ENUMS } from '../constants/log.ts';
|
|
10
4
|
import type { OrganizationOperationEnum } from '../types/organization.d.ts';
|
|
11
5
|
import type { AccountObj } from './account.d.ts';
|
|
6
|
+
import type { AppliedMemoriesSnapshot } from './agentMemory.d.ts';
|
|
12
7
|
import type { StorageGQL } from './storage.d.ts';
|
|
13
8
|
|
|
14
9
|
/**
|
|
@@ -16,351 +11,315 @@ import type { StorageGQL } from './storage.d.ts';
|
|
|
16
11
|
*/
|
|
17
12
|
|
|
18
13
|
export type LogContentName = 'log' | 'invoice' | 'receipt'; // For UI visuals, client-side only
|
|
19
|
-
export type LogSortEnum = typeof LOG_SORT_ENUMS[number];
|
|
20
|
-
export type RequestSourceEnum = typeof REQUEST_SOURCE_ENUMS[number];
|
|
14
|
+
export type LogSortEnum = (typeof LOG_SORT_ENUMS)[number];
|
|
15
|
+
export type RequestSourceEnum = (typeof REQUEST_SOURCE_ENUMS)[number];
|
|
16
|
+
|
|
17
|
+
// Activity and group keys are registry data and can be extended per organization.
|
|
18
|
+
export type LogTypeEnum = string;
|
|
19
|
+
export type LogActivityEnum = string;
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* Structured text translated for one ordered log item.
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| 'HARVEST'
|
|
31
|
-
| 'POST_HARVEST'
|
|
32
|
-
| 'SALES'
|
|
33
|
-
| 'WATER'
|
|
34
|
-
| 'HYGIENE'
|
|
35
|
-
| 'SANITATION'
|
|
36
|
-
| 'EQUIPMENT'
|
|
37
|
-
| 'BIOSECURITY'
|
|
38
|
-
| 'EMPLOYEE';
|
|
39
|
-
export type LogArableActivityEnum = typeof LOG_ARABLE_ACTIVITY_ENUMS[number];
|
|
25
|
+
export interface LogTranslationValueText {
|
|
26
|
+
ordinal: number;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
40
29
|
|
|
41
30
|
/**
|
|
42
|
-
*
|
|
31
|
+
* Structured text translated for one keyed log field.
|
|
43
32
|
*/
|
|
44
33
|
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
export interface LogTranslationFieldText {
|
|
35
|
+
key: string;
|
|
36
|
+
textValue: string;
|
|
37
|
+
}
|
|
48
38
|
|
|
49
39
|
/**
|
|
50
|
-
*
|
|
40
|
+
* One locale-specific translation of the current original log text.
|
|
51
41
|
*/
|
|
52
42
|
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
43
|
+
export interface LogTranslationLocaleText {
|
|
44
|
+
translatedAt: string;
|
|
45
|
+
summary: string | null;
|
|
46
|
+
notes: string | null;
|
|
47
|
+
item: string | null;
|
|
48
|
+
values: LogTranslationValueText[];
|
|
49
|
+
fields: LogTranslationFieldText[];
|
|
50
|
+
searchText: string;
|
|
51
|
+
}
|
|
61
52
|
|
|
62
53
|
/**
|
|
63
|
-
*
|
|
54
|
+
* Stored JSONB translation bundle keyed by target language code.
|
|
64
55
|
*/
|
|
65
56
|
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
typeof LOG_LIVESTOCK_ACTIVITY_ENUMS[number];
|
|
57
|
+
export interface LogTranslationBundle {
|
|
58
|
+
version: 1;
|
|
59
|
+
sourceHash: string;
|
|
60
|
+
originalLanguage: string;
|
|
61
|
+
// Target languages checked by the detector that required no translated payload.
|
|
62
|
+
noTranslationLanguages: string[];
|
|
63
|
+
texts: Record<string, LogTranslationLocaleText>;
|
|
64
|
+
}
|
|
75
65
|
|
|
76
66
|
/**
|
|
77
|
-
*
|
|
67
|
+
* GraphQL representation of one locale-specific translation.
|
|
78
68
|
*/
|
|
79
69
|
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
| LogGrowerNetworkTypeEnum
|
|
84
|
-
| LogLivestockTypeEnum;
|
|
85
|
-
|
|
86
|
-
export type LogActivityEnum =
|
|
87
|
-
| LogArableActivityEnum
|
|
88
|
-
| LogFarmersMarketActivityEnum
|
|
89
|
-
| LogGrowerNetworkActivityEnum
|
|
90
|
-
| LogLivestockActivityEnum;
|
|
70
|
+
export interface LogTranslationLocaleTextGQL extends LogTranslationLocaleText {
|
|
71
|
+
language: string;
|
|
72
|
+
}
|
|
91
73
|
|
|
92
74
|
/**
|
|
93
|
-
*
|
|
75
|
+
* GraphQL representation of a stored translation bundle.
|
|
94
76
|
*/
|
|
95
77
|
|
|
96
|
-
interface
|
|
97
|
-
|
|
98
|
-
item: string;
|
|
99
|
-
date: string;
|
|
100
|
-
time: string;
|
|
101
|
-
otherParty?: string;
|
|
102
|
-
referenceNumber?: string;
|
|
103
|
-
|
|
104
|
-
// Interface specific
|
|
105
|
-
values?: LabelAndValue[];
|
|
106
|
-
voided?: boolean;
|
|
107
|
-
|
|
108
|
-
summary?: string;
|
|
109
|
-
location?: string;
|
|
110
|
-
tax?: number; // Need to be removed and replaced by values[#].tax -- but this will require some logic changes
|
|
78
|
+
export interface LogTranslationBundleGQL extends Omit<LogTranslationBundle, 'noTranslationLanguages' | 'texts'> {
|
|
79
|
+
texts: LogTranslationLocaleTextGQL[];
|
|
111
80
|
}
|
|
112
81
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
unit: string;
|
|
117
|
-
concentration: number;
|
|
118
|
-
concentrationUnit: string;
|
|
119
|
-
}
|
|
82
|
+
/**
|
|
83
|
+
* Read-only log text selected for a viewer's display language.
|
|
84
|
+
*/
|
|
120
85
|
|
|
121
|
-
export interface
|
|
122
|
-
|
|
86
|
+
export interface LogDisplayText {
|
|
87
|
+
summary: string;
|
|
88
|
+
notes: string | null;
|
|
89
|
+
item: string | null;
|
|
90
|
+
values: LabelAndValue[] | null;
|
|
91
|
+
fields: LogEntryDetailsFieldGQL[] | null;
|
|
123
92
|
}
|
|
124
93
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Canonical translatable source payload used for hashing and LLM input.
|
|
96
|
+
*/
|
|
128
97
|
|
|
129
|
-
export interface
|
|
130
|
-
|
|
98
|
+
export interface LogTranslationSourceTexts {
|
|
99
|
+
summary: string | null;
|
|
100
|
+
notes: string | null;
|
|
101
|
+
item: string | null;
|
|
102
|
+
values: LogTranslationValueText[];
|
|
103
|
+
fields: LogTranslationFieldText[];
|
|
131
104
|
}
|
|
132
105
|
|
|
133
106
|
/**
|
|
134
|
-
*
|
|
107
|
+
* Shared log details fields
|
|
135
108
|
*/
|
|
136
109
|
|
|
137
110
|
export interface LogDetailsBase {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
111
|
+
id: number | bigint;
|
|
112
|
+
childOrg?: {
|
|
113
|
+
id: number | bigint;
|
|
114
|
+
name: string;
|
|
115
|
+
operation?: OrganizationOperationEnum | null;
|
|
116
|
+
};
|
|
117
|
+
childOrgId?: number | bigint | null;
|
|
118
|
+
fieldDocId?: number | bigint | null;
|
|
119
|
+
fieldDocSubmissionId?: number | bigint | null;
|
|
120
|
+
siteId?: number | bigint | null;
|
|
121
|
+
site?: {
|
|
122
|
+
id: number | bigint;
|
|
123
|
+
name: string;
|
|
124
|
+
};
|
|
125
|
+
location?: {
|
|
126
|
+
name: string;
|
|
127
|
+
} | null;
|
|
128
|
+
notes: string | null;
|
|
129
|
+
translation: LogTranslationBundle | null;
|
|
157
130
|
}
|
|
158
131
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
132
|
+
// All operations use one registry-driven details shape.
|
|
133
|
+
export interface LogEntryDetailsData extends LogDetailsBase {
|
|
134
|
+
__table: 'log_entry_details';
|
|
135
|
+
activity: string;
|
|
136
|
+
logType?: string | null;
|
|
137
|
+
fields?: LogEntryDetailsFieldGQL[] | null;
|
|
138
|
+
metadata?: Record<string, any> | null;
|
|
163
139
|
}
|
|
164
140
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
141
|
+
// One typed field-def value on a registry-driven operation's log
|
|
142
|
+
export interface LogEntryDetailsFieldGQL {
|
|
143
|
+
key: string;
|
|
144
|
+
fieldType: string | null;
|
|
145
|
+
textValue: string | null;
|
|
146
|
+
numberValue: number | null;
|
|
147
|
+
booleanValue: boolean | null;
|
|
148
|
+
dateValue: string | null;
|
|
149
|
+
datetimeValue: string | null;
|
|
150
|
+
unit: string | null;
|
|
169
151
|
}
|
|
170
152
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
metadata?: Partial<LogGrowerNetworkMetadata> | null;
|
|
153
|
+
// One typed field-def value sent when editing a registry-driven log
|
|
154
|
+
export interface LogEntryDetailsFieldInput {
|
|
155
|
+
key: string;
|
|
156
|
+
textValue?: string | null;
|
|
157
|
+
numberValue?: number | null;
|
|
158
|
+
booleanValue?: boolean | null;
|
|
159
|
+
dateValue?: string | null;
|
|
160
|
+
datetimeValue?: string | null;
|
|
161
|
+
unit?: string | null;
|
|
162
|
+
clear?: boolean | null;
|
|
182
163
|
}
|
|
183
164
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
165
|
+
// Details for registry-driven operations; type/activity are registry keys
|
|
166
|
+
export interface LogEntryDetailsGQL {
|
|
167
|
+
__typename: 'LogEntryDetails';
|
|
168
|
+
|
|
169
|
+
id: string;
|
|
170
|
+
type: string | null;
|
|
171
|
+
activity: string;
|
|
172
|
+
notes: string;
|
|
173
|
+
|
|
174
|
+
item: string | null;
|
|
175
|
+
quantity: number | null;
|
|
176
|
+
unit: string | null;
|
|
177
|
+
price: number | null;
|
|
178
|
+
values: LabelAndValue[] | null;
|
|
179
|
+
fields: LogEntryDetailsFieldGQL[] | null;
|
|
180
|
+
|
|
181
|
+
otherParty: string | null;
|
|
182
|
+
referenceNumber: string | null;
|
|
183
|
+
fieldLocation: string | null;
|
|
184
|
+
voided: boolean | null;
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
activity: LogActivityEnum;
|
|
198
|
-
summary: string | null;
|
|
199
|
-
notes: string;
|
|
187
|
+
// Log taxonomy carried by the existing organization bootstrap (registry rows)
|
|
188
|
+
export interface LogTaxonomyGroupGQL {
|
|
189
|
+
key: string;
|
|
190
|
+
label: string | null;
|
|
191
|
+
ordinal: number | null;
|
|
192
|
+
requiredFields: string[] | null;
|
|
193
|
+
orRequiredFields: string[] | null;
|
|
200
194
|
}
|
|
201
195
|
|
|
202
|
-
export interface
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
fieldLocation: string | null;
|
|
211
|
-
otherParty: string | null;
|
|
212
|
-
referenceNumber: string | null;
|
|
213
|
-
values: LabelAndValue[] | null;
|
|
214
|
-
tax: number | null;
|
|
215
|
-
voided: boolean | null;
|
|
196
|
+
export interface LogTaxonomyActivityGQL {
|
|
197
|
+
systemOnly?: boolean | null;
|
|
198
|
+
key: string;
|
|
199
|
+
groupKey: string | null;
|
|
200
|
+
agentText: string | null;
|
|
201
|
+
ordinal: number | null;
|
|
202
|
+
requiredFields: string[] | null;
|
|
203
|
+
orRequiredFields: string[] | null;
|
|
216
204
|
}
|
|
217
205
|
|
|
218
|
-
export interface
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
206
|
+
export interface LogTaxonomyFieldDefGQL {
|
|
207
|
+
key: string;
|
|
208
|
+
fieldType: string;
|
|
209
|
+
required: boolean | null;
|
|
210
|
+
ordinal: number | null;
|
|
211
|
+
agentHint: string | null;
|
|
212
|
+
options: string[] | null;
|
|
213
|
+
allowedUnits: string[] | null;
|
|
214
|
+
includedActivityKeys?: string[] | null;
|
|
215
|
+
excludedActivityKeys?: string[] | null;
|
|
216
|
+
groupKey: string | null;
|
|
217
|
+
activityKey: string | null;
|
|
227
218
|
}
|
|
228
219
|
|
|
229
|
-
export interface
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
fieldRisk: boolean;
|
|
235
|
-
contaminationRisk: boolean;
|
|
236
|
-
hygieneRisk: boolean;
|
|
237
|
-
pestsRisk: boolean;
|
|
238
|
-
sanitationRisk: boolean;
|
|
239
|
-
otherParty: string | null;
|
|
240
|
-
item: string | null;
|
|
241
|
-
fieldLocation: string | null;
|
|
220
|
+
export interface LogTaxonomyGQL {
|
|
221
|
+
operation: string;
|
|
222
|
+
groups: LogTaxonomyGroupGQL[];
|
|
223
|
+
activities: LogTaxonomyActivityGQL[];
|
|
224
|
+
fieldDefs: LogTaxonomyFieldDefGQL[];
|
|
242
225
|
}
|
|
243
226
|
|
|
244
|
-
export interface LogLivestockDetailsGQL extends LogDetailsBaseGQL {
|
|
245
|
-
__typename: 'LogLivestock';
|
|
246
|
-
|
|
247
|
-
livestock: string | null;
|
|
248
|
-
livestockIdentifiers: string[] | null;
|
|
249
|
-
livestockGroup: string | null;
|
|
250
|
-
damIdentifier: string | null;
|
|
251
|
-
otherParty: string | null;
|
|
252
|
-
referenceNumber: string | null;
|
|
253
|
-
values: LabelAndValue[] | null;
|
|
254
|
-
tax: number | null;
|
|
255
|
-
voided: boolean | null;
|
|
256
|
-
item: string | null;
|
|
257
|
-
quantity: number | null;
|
|
258
|
-
unit: string | null;
|
|
259
|
-
price: number | null;
|
|
260
|
-
fieldLocation: string | null;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Union type for log details
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
|
-
export type LogMetadataGQL =
|
|
268
|
-
| LogArableDetailsGQL
|
|
269
|
-
| LogFarmersMarketDetailsGQL
|
|
270
|
-
| LogGrowerNetworkDetailsGQL
|
|
271
|
-
| LogLivestockDetailsGQL;
|
|
272
|
-
|
|
273
227
|
/**
|
|
274
228
|
* GQL data interfaces
|
|
275
229
|
*/
|
|
276
230
|
|
|
277
231
|
export interface LogEntryGQL {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
232
|
+
__typename: string;
|
|
233
|
+
__deleted?: boolean;
|
|
234
|
+
|
|
235
|
+
id: string;
|
|
236
|
+
cursor?: string | null;
|
|
237
|
+
accountId: string;
|
|
238
|
+
organizationId: string;
|
|
239
|
+
childOrgId: string | null;
|
|
240
|
+
childOrgName: string | null;
|
|
241
|
+
inboundContactId: string | null;
|
|
242
|
+
inboundContactName: string | null;
|
|
243
|
+
inboundContactEmail?: string | null;
|
|
244
|
+
inboundContactPhone?: string | null;
|
|
245
|
+
fieldDocId: string | null;
|
|
246
|
+
fieldDocSubmissionId: string | null;
|
|
247
|
+
siteId: string | null;
|
|
248
|
+
siteName?: string | null;
|
|
249
|
+
location: string | null;
|
|
250
|
+
accountPersonName?: string | null;
|
|
251
|
+
details: LogEntryDetailsGQL;
|
|
252
|
+
summary: string;
|
|
253
|
+
source?: RequestSourceEnum | null;
|
|
254
|
+
confidence?: number | null;
|
|
255
|
+
originalMessage?: string | null;
|
|
256
|
+
flagColor?: string | null;
|
|
257
|
+
translation: LogTranslationBundleGQL | null;
|
|
258
|
+
|
|
259
|
+
account: any;
|
|
260
|
+
files: StorageGQL[];
|
|
261
|
+
|
|
262
|
+
date: string; // ISO date string
|
|
263
|
+
createdAt: string; // ISO date string
|
|
264
|
+
updatedAt: string; // ISO date string
|
|
305
265
|
}
|
|
306
266
|
|
|
307
267
|
export interface LogEntryInsertObj {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
268
|
+
id?: number | bigint; // Only for edits
|
|
269
|
+
accountId: number | bigint | null;
|
|
270
|
+
organizationId: number | bigint;
|
|
271
|
+
childOrgId?: number | bigint | null;
|
|
272
|
+
inboundContactId?: number | bigint | null;
|
|
273
|
+
emailId?: number | bigint | null;
|
|
274
|
+
fieldDocId?: number | bigint | null;
|
|
275
|
+
fieldDocSubmissionId?: number | bigint | null;
|
|
276
|
+
siteId?: number | bigint | null;
|
|
277
|
+
summary: string;
|
|
278
|
+
source?: RequestSourceEnum | null;
|
|
279
|
+
confidence?: number | null;
|
|
280
|
+
originalMessage?: string | null;
|
|
281
|
+
appliedMemories?: AppliedMemoriesSnapshot | null;
|
|
282
|
+
details: any;
|
|
283
|
+
date: Date;
|
|
323
284
|
}
|
|
324
285
|
|
|
325
286
|
export interface LogEntryData {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
// This is for outputs, but will never be set for inserts
|
|
363
|
-
account?: AccountObj;
|
|
287
|
+
revisionNumber?: number;
|
|
288
|
+
__table: 'logs';
|
|
289
|
+
id: number | bigint;
|
|
290
|
+
accountId: number | bigint;
|
|
291
|
+
organizationId: number | bigint;
|
|
292
|
+
childOrgId?: number | bigint | null;
|
|
293
|
+
inboundContactId?: number | bigint | null;
|
|
294
|
+
emailId?: number | bigint | null;
|
|
295
|
+
inboundContact?: {
|
|
296
|
+
id: number | bigint;
|
|
297
|
+
personName?: string | null;
|
|
298
|
+
} | null;
|
|
299
|
+
childOrg?: {
|
|
300
|
+
id: number | bigint;
|
|
301
|
+
name: string;
|
|
302
|
+
operation?: OrganizationOperationEnum | null;
|
|
303
|
+
} | null;
|
|
304
|
+
fieldDocId?: number | bigint | null;
|
|
305
|
+
fieldDocSubmissionId?: number | bigint | null;
|
|
306
|
+
siteId?: number | bigint | null;
|
|
307
|
+
summary: string;
|
|
308
|
+
source?: RequestSourceEnum | null;
|
|
309
|
+
confidence?: number | null;
|
|
310
|
+
originalMessage?: string | null;
|
|
311
|
+
translation?: LogTranslationBundle | null;
|
|
312
|
+
location?: {
|
|
313
|
+
name: string;
|
|
314
|
+
} | null;
|
|
315
|
+
distance?: number; // For vector search
|
|
316
|
+
details: LogEntryDetailsData;
|
|
317
|
+
date: Date;
|
|
318
|
+
createdAt: Date;
|
|
319
|
+
updatedAt: Date;
|
|
320
|
+
|
|
321
|
+
// This is for outputs, but will never be set for inserts
|
|
322
|
+
account?: AccountObj;
|
|
364
323
|
}
|
|
365
324
|
|
|
366
325
|
/**
|
|
@@ -368,12 +327,12 @@ export interface LogEntryData {
|
|
|
368
327
|
*/
|
|
369
328
|
|
|
370
329
|
export interface FilterLogEntriesArgs {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
330
|
+
accountId?: string | null; // Account ID to filter logs by account
|
|
331
|
+
siteId?: string | number | bigint | null; // Site ID to filter logs by site
|
|
332
|
+
preset?: 'WEEKS_5' | null;
|
|
333
|
+
types?: string[] | null;
|
|
334
|
+
activities?: string[] | null;
|
|
335
|
+
startDate?: string | null; // CalDate, with dashes (YYYY-MM-DD)
|
|
336
|
+
endDate?: string | null; // CalDate, with dashes (YYYY-MM-DD)
|
|
337
|
+
query?: string | null;
|
|
379
338
|
}
|