@voyantjs/crm 0.26.2 → 0.26.4

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/index.d.ts CHANGED
@@ -20,10 +20,14 @@ export declare const crmHonoModule: HonoModule;
20
20
  export { crmBookingExtension } from "./booking-extension.js";
21
21
  export type { CrmRouteRuntime, CrmRouteRuntimeOptions, ResolveCrmKmsProvider, } from "./route-runtime.js";
22
22
  export { buildCrmRouteRuntime, CRM_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
23
- export type { Activity, ActivityLink, ActivityParticipant, CommunicationLogEntry, CustomFieldDefinition, CustomFieldValue, NewActivity, NewActivityLink, NewActivityParticipant, NewCommunicationLogEntry, NewCustomFieldDefinition, NewCustomFieldValue, NewOpportunity, NewOpportunityParticipant, NewOpportunityProduct, NewOrganization, NewOrganizationNote, NewPerson, NewPersonDocument, NewPersonNote, NewPipeline, NewQuote, NewQuoteLine, NewSegment, NewSegmentMember, NewStage, Opportunity, OpportunityParticipant, OpportunityProduct, Organization, OrganizationNote, Person, PersonDocument, PersonNote, Pipeline, Quote, QuoteLine, Segment, SegmentMember, Stage, } from "./schema.js";
24
- export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
23
+ export type { Activity, ActivityLink, ActivityParticipant, CommunicationLogEntry, CustomerSignal, CustomFieldDefinition, CustomFieldValue, NewActivity, NewActivityLink, NewActivityParticipant, NewCommunicationLogEntry, NewCustomerSignal, NewCustomFieldDefinition, NewCustomFieldValue, NewOpportunity, NewOpportunityParticipant, NewOpportunityProduct, NewOrganization, NewOrganizationNote, NewPerson, NewPersonDocument, NewPersonNote, NewPersonRelationship, NewPipeline, NewQuote, NewQuoteLine, NewSegment, NewSegmentMember, NewStage, Opportunity, OpportunityParticipant, OpportunityProduct, Organization, OrganizationNote, Person, PersonDocument, PersonNote, PersonRelationship, Pipeline, Quote, QuoteLine, Segment, SegmentMember, Stage, } from "./schema.js";
24
+ export { activities, activityLinks, activityParticipants, communicationLog, customerSignalKindEnum, customerSignalSourceEnum, customerSignalStatusEnum, customerSignals, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, personRelationshipKindEnum, personRelationships, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
25
+ export type { CreateCustomerSignalInput, CustomerSignalListQuery, UpdateCustomerSignalInput, } from "./service/customer-signals.js";
26
+ export { customerSignalsService } from "./service/customer-signals.js";
25
27
  export type { CreatePersonDocumentInput, PersonDocumentListQuery, PersonDocumentType, PersonTravelSnapshot, UpdatePersonDocumentInput, } from "./service/person-documents.js";
26
28
  export { personDocumentNumberPlaintextSchema, personDocumentsService, personPiiBlobPlaintextSchema, } from "./service/person-documents.js";
27
- export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
29
+ export type { CreatePersonRelationshipInput, PersonRelationshipKind, PersonRelationshipListQuery, UpdatePersonRelationshipInput, } from "./service/person-relationships.js";
30
+ export { personRelationshipsService } from "./service/person-relationships.js";
31
+ export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customerSignalKindSchema, customerSignalListQuerySchema, customerSignalPrioritySchema, customerSignalSourceSchema, customerSignalStatusSchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomerSignalSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonRelationshipSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, personRelationshipKindSchema, personRelationshipListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, resolveCustomerSignalSchema, stageListQuerySchema, updateActivitySchema, updateCustomerSignalSchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonRelationshipSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
28
32
  export { crmService };
29
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sour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EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,uCAAuC,EACvC,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,4BAA4B,EAC5B,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,uCAAuC,EACvC,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,CAAA"}
package/dist/index.js CHANGED
@@ -42,7 +42,9 @@ export function createCrmHonoModule(options = {}) {
42
42
  export const crmHonoModule = createCrmHonoModule();
43
43
  export { crmBookingExtension } from "./booking-extension.js";
44
44
  export { buildCrmRouteRuntime, CRM_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
45
- export { activities, activityLinks, activityParticipants, communicationLog, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
45
+ export { activities, activityLinks, activityParticipants, communicationLog, customerSignalKindEnum, customerSignalSourceEnum, customerSignalStatusEnum, customerSignals, customFieldDefinitions, customFieldValues, opportunities, opportunityParticipants, opportunityProducts, organizationNotes, organizations, people, personDocuments, personDocumentTypeEnum, personNotes, personRelationshipKindEnum, personRelationships, pipelines, quoteLines, quotes, segmentMembers, segments, stages, } from "./schema.js";
46
+ export { customerSignalsService } from "./service/customer-signals.js";
46
47
  export { personDocumentNumberPlaintextSchema, personDocumentsService, personPiiBlobPlaintextSchema, } from "./service/person-documents.js";
47
- export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, stageListQuerySchema, updateActivitySchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
48
+ export { personRelationshipsService } from "./service/person-relationships.js";
49
+ export { activityListQuerySchema, communicationChannelSchema, communicationDirectionSchema, communicationListQuerySchema, customerSignalKindSchema, customerSignalListQuerySchema, customerSignalPrioritySchema, customerSignalSourceSchema, customerSignalStatusSchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, insertActivityLinkSchema, insertActivityParticipantSchema, insertActivitySchema, insertCommunicationLogSchema, insertCustomerSignalSchema, insertCustomFieldDefinitionSchema, insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, insertOrganizationNoteSchema, insertOrganizationSchema, insertPersonDocumentFromPlaintextSchema, insertPersonDocumentSchema, insertPersonNoteSchema, insertPersonRelationshipSchema, insertPersonSchema, insertPipelineSchema, insertQuoteLineSchema, insertQuoteSchema, insertSegmentSchema, insertStageSchema, opportunityListQuerySchema, organizationListQuerySchema, personDocumentListQuerySchema, personDocumentTypeSchema, personListQuerySchema, personRelationshipKindSchema, personRelationshipListQuerySchema, pipelineListQuerySchema, quoteListQuerySchema, relationTypeSchema, resolveCustomerSignalSchema, stageListQuerySchema, updateActivitySchema, updateCustomerSignalSchema, updateCustomFieldDefinitionSchema, updateOpportunityProductSchema, updateOpportunitySchema, updateOrganizationSchema, updatePersonDocumentFromPlaintextSchema, updatePersonDocumentSchema, updatePersonProfilePiiSchema, updatePersonRelationshipSchema, updatePersonSchema, updatePipelineSchema, updateQuoteLineSchema, updateQuoteSchema, updateStageSchema, upsertCustomFieldValueSchema, } from "./validation.js";
48
50
  export { crmService };
@@ -0,0 +1,281 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ type Env = {
3
+ Variables: {
4
+ db: PostgresJsDatabase;
5
+ userId?: string;
6
+ };
7
+ };
8
+ export declare const customerSignalRoutes: import("hono/hono-base").HonoBase<Env, {
9
+ "/customer-signals": {
10
+ $get: {
11
+ input: {};
12
+ output: {
13
+ data: {
14
+ id: string;
15
+ personId: string;
16
+ productId: string | null;
17
+ optionUnitId: string | null;
18
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
19
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
20
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
21
+ priority: string;
22
+ notes: string | null;
23
+ tags: string[];
24
+ assignedToUserId: string | null;
25
+ followUpAt: string | null;
26
+ resolvedBookingId: string | null;
27
+ sourceSubmissionId: string | null;
28
+ metadata: {
29
+ [x: string]: import("hono/utils/types").JSONValue;
30
+ } | null;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ }[];
34
+ total: number;
35
+ limit: number;
36
+ offset: number;
37
+ };
38
+ outputFormat: "json";
39
+ status: import("hono/utils/http-status").ContentfulStatusCode;
40
+ };
41
+ };
42
+ } & {
43
+ "/customer-signals": {
44
+ $post: {
45
+ input: {};
46
+ output: {
47
+ error: string;
48
+ };
49
+ outputFormat: "json";
50
+ status: 404;
51
+ } | {
52
+ input: {};
53
+ output: {
54
+ data: {
55
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
56
+ metadata: {
57
+ [x: string]: import("hono/utils/types").JSONValue;
58
+ } | null;
59
+ id: string;
60
+ createdAt: string;
61
+ updatedAt: string;
62
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
63
+ notes: string | null;
64
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
65
+ tags: string[];
66
+ personId: string;
67
+ productId: string | null;
68
+ optionUnitId: string | null;
69
+ priority: string;
70
+ assignedToUserId: string | null;
71
+ followUpAt: string | null;
72
+ resolvedBookingId: string | null;
73
+ sourceSubmissionId: string | null;
74
+ };
75
+ };
76
+ outputFormat: "json";
77
+ status: 201;
78
+ };
79
+ };
80
+ } & {
81
+ "/customer-signals/:id": {
82
+ $get: {
83
+ input: {
84
+ param: {
85
+ id: string;
86
+ };
87
+ };
88
+ output: {
89
+ error: string;
90
+ };
91
+ outputFormat: "json";
92
+ status: 404;
93
+ } | {
94
+ input: {
95
+ param: {
96
+ id: string;
97
+ };
98
+ };
99
+ output: {
100
+ data: {
101
+ id: string;
102
+ personId: string;
103
+ productId: string | null;
104
+ optionUnitId: string | null;
105
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
106
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
107
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
108
+ priority: string;
109
+ notes: string | null;
110
+ tags: string[];
111
+ assignedToUserId: string | null;
112
+ followUpAt: string | null;
113
+ resolvedBookingId: string | null;
114
+ sourceSubmissionId: string | null;
115
+ metadata: {
116
+ [x: string]: import("hono/utils/types").JSONValue;
117
+ } | null;
118
+ createdAt: string;
119
+ updatedAt: string;
120
+ };
121
+ };
122
+ outputFormat: "json";
123
+ status: import("hono/utils/http-status").ContentfulStatusCode;
124
+ };
125
+ };
126
+ } & {
127
+ "/customer-signals/:id": {
128
+ $patch: {
129
+ input: {
130
+ param: {
131
+ id: string;
132
+ };
133
+ };
134
+ output: {
135
+ error: string;
136
+ };
137
+ outputFormat: "json";
138
+ status: 404;
139
+ } | {
140
+ input: {
141
+ param: {
142
+ id: string;
143
+ };
144
+ };
145
+ output: {
146
+ data: {
147
+ id: string;
148
+ personId: string;
149
+ productId: string | null;
150
+ optionUnitId: string | null;
151
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
152
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
153
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
154
+ priority: string;
155
+ notes: string | null;
156
+ tags: string[];
157
+ assignedToUserId: string | null;
158
+ followUpAt: string | null;
159
+ resolvedBookingId: string | null;
160
+ sourceSubmissionId: string | null;
161
+ metadata: {
162
+ [x: string]: import("hono/utils/types").JSONValue;
163
+ } | null;
164
+ createdAt: string;
165
+ updatedAt: string;
166
+ };
167
+ };
168
+ outputFormat: "json";
169
+ status: import("hono/utils/http-status").ContentfulStatusCode;
170
+ };
171
+ };
172
+ } & {
173
+ "/customer-signals/:id": {
174
+ $delete: {
175
+ input: {
176
+ param: {
177
+ id: string;
178
+ };
179
+ };
180
+ output: {
181
+ error: string;
182
+ };
183
+ outputFormat: "json";
184
+ status: 404;
185
+ } | {
186
+ input: {
187
+ param: {
188
+ id: string;
189
+ };
190
+ };
191
+ output: {
192
+ success: true;
193
+ };
194
+ outputFormat: "json";
195
+ status: import("hono/utils/http-status").ContentfulStatusCode;
196
+ };
197
+ };
198
+ } & {
199
+ "/customer-signals/:id/resolve": {
200
+ $post: {
201
+ input: {
202
+ param: {
203
+ id: string;
204
+ };
205
+ };
206
+ output: {
207
+ error: string;
208
+ };
209
+ outputFormat: "json";
210
+ status: 404;
211
+ } | {
212
+ input: {
213
+ param: {
214
+ id: string;
215
+ };
216
+ };
217
+ output: {
218
+ data: {
219
+ id: string;
220
+ personId: string;
221
+ productId: string | null;
222
+ optionUnitId: string | null;
223
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
224
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
225
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
226
+ priority: string;
227
+ notes: string | null;
228
+ tags: string[];
229
+ assignedToUserId: string | null;
230
+ followUpAt: string | null;
231
+ resolvedBookingId: string | null;
232
+ sourceSubmissionId: string | null;
233
+ metadata: {
234
+ [x: string]: import("hono/utils/types").JSONValue;
235
+ } | null;
236
+ createdAt: string;
237
+ updatedAt: string;
238
+ };
239
+ };
240
+ outputFormat: "json";
241
+ status: import("hono/utils/http-status").ContentfulStatusCode;
242
+ };
243
+ };
244
+ } & {
245
+ "/people/:id/signals": {
246
+ $get: {
247
+ input: {
248
+ param: {
249
+ id: string;
250
+ };
251
+ };
252
+ output: {
253
+ data: {
254
+ id: string;
255
+ personId: string;
256
+ productId: string | null;
257
+ optionUnitId: string | null;
258
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
259
+ source: "admin" | "form" | "phone" | "website" | "abandoned_cart" | "booking";
260
+ status: "lost" | "expired" | "new" | "contacted" | "qualified" | "converted";
261
+ priority: string;
262
+ notes: string | null;
263
+ tags: string[];
264
+ assignedToUserId: string | null;
265
+ followUpAt: string | null;
266
+ resolvedBookingId: string | null;
267
+ sourceSubmissionId: string | null;
268
+ metadata: {
269
+ [x: string]: import("hono/utils/types").JSONValue;
270
+ } | null;
271
+ createdAt: string;
272
+ updatedAt: string;
273
+ }[];
274
+ };
275
+ outputFormat: "json";
276
+ status: import("hono/utils/http-status").ContentfulStatusCode;
277
+ };
278
+ };
279
+ }, "/", "/people/:id/signals">;
280
+ export {};
281
+ //# sourceMappingURL=customer-signals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-signals.d.ts","sourceRoot":"","sources":["../../src/routes/customer-signals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAWjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA8C7B,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { parseJsonBody, parseQuery } from "@voyantjs/hono";
2
+ import { Hono } from "hono";
3
+ import { crmService } from "../service/index.js";
4
+ import { customerSignalListQuerySchema, insertCustomerSignalSchema, resolveCustomerSignalSchema, updateCustomerSignalSchema, } from "../validation.js";
5
+ export const customerSignalRoutes = new Hono()
6
+ .get("/customer-signals", async (c) => {
7
+ const query = parseQuery(c, customerSignalListQuerySchema);
8
+ return c.json(await crmService.listCustomerSignals(c.get("db"), query));
9
+ })
10
+ .post("/customer-signals", async (c) => {
11
+ const row = await crmService.createCustomerSignal(c.get("db"), await parseJsonBody(c, insertCustomerSignalSchema));
12
+ if (!row)
13
+ return c.json({ error: "Person not found" }, 404);
14
+ return c.json({ data: row }, 201);
15
+ })
16
+ .get("/customer-signals/:id", async (c) => {
17
+ const row = await crmService.getCustomerSignal(c.get("db"), c.req.param("id"));
18
+ if (!row)
19
+ return c.json({ error: "Signal not found" }, 404);
20
+ return c.json({ data: row });
21
+ })
22
+ .patch("/customer-signals/:id", async (c) => {
23
+ const row = await crmService.updateCustomerSignal(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateCustomerSignalSchema));
24
+ if (!row)
25
+ return c.json({ error: "Signal not found" }, 404);
26
+ return c.json({ data: row });
27
+ })
28
+ .delete("/customer-signals/:id", async (c) => {
29
+ const row = await crmService.deleteCustomerSignal(c.get("db"), c.req.param("id"));
30
+ if (!row)
31
+ return c.json({ error: "Signal not found" }, 404);
32
+ return c.json({ success: true });
33
+ })
34
+ .post("/customer-signals/:id/resolve", async (c) => {
35
+ const body = await parseJsonBody(c, resolveCustomerSignalSchema);
36
+ const row = await crmService.resolveCustomerSignalToBooking(c.get("db"), c.req.param("id"), body.bookingId);
37
+ if (!row)
38
+ return c.json({ error: "Signal not found" }, 404);
39
+ return c.json({ data: row });
40
+ })
41
+ .get("/people/:id/signals", async (c) => {
42
+ return c.json({
43
+ data: await crmService.listSignalsForPerson(c.get("db"), c.req.param("id")),
44
+ });
45
+ });