@voyantjs/crm 0.4.5 → 0.6.0
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/booking-extension.d.ts +2 -2
- package/dist/booking-extension.d.ts.map +1 -1
- package/dist/booking-extension.js +2 -1
- package/dist/routes/accounts.d.ts +42 -64
- package/dist/routes/accounts.d.ts.map +1 -1
- package/dist/routes/accounts.js +22 -25
- package/dist/routes/activities.d.ts +6 -6
- package/dist/routes/activities.d.ts.map +1 -1
- package/dist/routes/activities.js +6 -5
- package/dist/routes/custom-fields.d.ts +6 -6
- package/dist/routes/custom-fields.d.ts.map +1 -1
- package/dist/routes/custom-fields.js +6 -5
- package/dist/routes/index.d.ts +73 -95
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/opportunities.d.ts +10 -10
- package/dist/routes/opportunities.d.ts.map +1 -1
- package/dist/routes/opportunities.js +7 -6
- package/dist/routes/pipelines.d.ts +2 -2
- package/dist/routes/pipelines.d.ts.map +1 -1
- package/dist/routes/pipelines.js +7 -6
- package/dist/routes/quotes.d.ts +7 -7
- package/dist/routes/quotes.d.ts.map +1 -1
- package/dist/routes/quotes.js +6 -5
- package/dist/schema-accounts.d.ts +1 -1
- package/dist/schema-activities.d.ts +1 -1
- package/dist/service/accounts-organizations.d.ts +4 -4
- package/dist/service/accounts-people.d.ts +21 -21
- package/dist/service/accounts.d.ts +25 -25
- package/dist/service/activities.d.ts +6 -6
- package/dist/service/custom-fields.d.ts +6 -6
- package/dist/service/index.d.ts +58 -58
- package/dist/service/opportunities.d.ts +10 -10
- package/dist/service/pipelines.d.ts +2 -2
- package/dist/service/quotes.d.ts +7 -7
- package/dist/validation.d.ts +11 -11
- package/package.json +5 -5
|
@@ -45,16 +45,16 @@ export declare const opportunityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
45
45
|
input: {};
|
|
46
46
|
output: {
|
|
47
47
|
data: {
|
|
48
|
+
source: string | null;
|
|
49
|
+
id: string;
|
|
48
50
|
createdAt: string;
|
|
49
51
|
updatedAt: string;
|
|
52
|
+
organizationId: string | null;
|
|
53
|
+
status: "archived" | "open" | "won" | "lost";
|
|
50
54
|
title: string;
|
|
51
|
-
id: string;
|
|
52
55
|
ownerId: string | null;
|
|
53
|
-
status: "archived" | "open" | "won" | "lost";
|
|
54
|
-
source: string | null;
|
|
55
56
|
sourceRef: string | null;
|
|
56
57
|
tags: string[];
|
|
57
|
-
organizationId: string | null;
|
|
58
58
|
personId: string | null;
|
|
59
59
|
pipelineId: string;
|
|
60
60
|
stageId: string;
|
|
@@ -220,11 +220,11 @@ export declare const opportunityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
220
220
|
};
|
|
221
221
|
output: {
|
|
222
222
|
data: {
|
|
223
|
-
|
|
223
|
+
id: string;
|
|
224
224
|
createdAt: string;
|
|
225
|
-
isPrimary: boolean;
|
|
226
225
|
role: "other" | "traveler" | "booker" | "decision_maker" | "finance";
|
|
227
|
-
|
|
226
|
+
opportunityId: string;
|
|
227
|
+
isPrimary: boolean;
|
|
228
228
|
personId: string;
|
|
229
229
|
} | undefined;
|
|
230
230
|
};
|
|
@@ -297,18 +297,18 @@ export declare const opportunityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
297
297
|
};
|
|
298
298
|
output: {
|
|
299
299
|
data: {
|
|
300
|
-
|
|
300
|
+
id: string;
|
|
301
301
|
createdAt: string;
|
|
302
302
|
updatedAt: string;
|
|
303
|
+
currency: string | null;
|
|
303
304
|
description: string | null;
|
|
304
|
-
|
|
305
|
+
opportunityId: string;
|
|
305
306
|
productId: string | null;
|
|
306
307
|
supplierServiceId: string | null;
|
|
307
308
|
nameSnapshot: string;
|
|
308
309
|
quantity: number;
|
|
309
310
|
unitPriceAmountCents: number | null;
|
|
310
311
|
costAmountCents: number | null;
|
|
311
|
-
currency: string | null;
|
|
312
312
|
discountAmountCents: number | null;
|
|
313
313
|
} | undefined;
|
|
314
314
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opportunities.d.ts","sourceRoot":"","sources":["../../src/routes/opportunities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opportunities.d.ts","sourceRoot":"","sources":["../../src/routes/opportunities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAajE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAuF1B,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { parseJsonBody, parseQuery } from "@voyantjs/hono";
|
|
1
2
|
import { Hono } from "hono";
|
|
2
3
|
import { crmService } from "../service/index.js";
|
|
3
4
|
import { insertOpportunityParticipantSchema, insertOpportunityProductSchema, insertOpportunitySchema, opportunityListQuerySchema, updateOpportunityProductSchema, updateOpportunitySchema, } from "../validation.js";
|
|
4
5
|
export const opportunityRoutes = new Hono()
|
|
5
6
|
.get("/opportunities", async (c) => {
|
|
6
|
-
const query =
|
|
7
|
+
const query = await parseQuery(c, opportunityListQuerySchema);
|
|
7
8
|
return c.json(await crmService.listOpportunities(c.get("db"), query));
|
|
8
9
|
})
|
|
9
10
|
.post("/opportunities", async (c) => {
|
|
10
11
|
return c.json({
|
|
11
|
-
data: await crmService.createOpportunity(c.get("db"),
|
|
12
|
+
data: await crmService.createOpportunity(c.get("db"), await parseJsonBody(c, insertOpportunitySchema)),
|
|
12
13
|
}, 201);
|
|
13
14
|
})
|
|
14
15
|
.get("/opportunities/:id", async (c) => {
|
|
@@ -18,7 +19,7 @@ export const opportunityRoutes = new Hono()
|
|
|
18
19
|
return c.json({ data: row });
|
|
19
20
|
})
|
|
20
21
|
.patch("/opportunities/:id", async (c) => {
|
|
21
|
-
const row = await crmService.updateOpportunity(c.get("db"), c.req.param("id"),
|
|
22
|
+
const row = await crmService.updateOpportunity(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateOpportunitySchema));
|
|
22
23
|
if (!row)
|
|
23
24
|
return c.json({ error: "Opportunity not found" }, 404);
|
|
24
25
|
return c.json({ data: row });
|
|
@@ -36,7 +37,7 @@ export const opportunityRoutes = new Hono()
|
|
|
36
37
|
})
|
|
37
38
|
.post("/opportunities/:id/participants", async (c) => {
|
|
38
39
|
return c.json({
|
|
39
|
-
data: await crmService.createOpportunityParticipant(c.get("db"), c.req.param("id"),
|
|
40
|
+
data: await crmService.createOpportunityParticipant(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertOpportunityParticipantSchema)),
|
|
40
41
|
}, 201);
|
|
41
42
|
})
|
|
42
43
|
.delete("/opportunity-participants/:id", async (c) => {
|
|
@@ -52,11 +53,11 @@ export const opportunityRoutes = new Hono()
|
|
|
52
53
|
})
|
|
53
54
|
.post("/opportunities/:id/products", async (c) => {
|
|
54
55
|
return c.json({
|
|
55
|
-
data: await crmService.createOpportunityProduct(c.get("db"), c.req.param("id"),
|
|
56
|
+
data: await crmService.createOpportunityProduct(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertOpportunityProductSchema)),
|
|
56
57
|
}, 201);
|
|
57
58
|
})
|
|
58
59
|
.patch("/opportunity-products/:id", async (c) => {
|
|
59
|
-
const row = await crmService.updateOpportunityProduct(c.get("db"), c.req.param("id"),
|
|
60
|
+
const row = await crmService.updateOpportunityProduct(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateOpportunityProductSchema));
|
|
60
61
|
if (!row)
|
|
61
62
|
return c.json({ error: "Opportunity product not found" }, 404);
|
|
62
63
|
return c.json({ data: row });
|
|
@@ -33,11 +33,11 @@ export declare const pipelineRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
33
33
|
input: {};
|
|
34
34
|
output: {
|
|
35
35
|
data: {
|
|
36
|
+
id: string;
|
|
36
37
|
name: string;
|
|
37
38
|
createdAt: string;
|
|
38
39
|
updatedAt: string;
|
|
39
40
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
40
|
-
id: string;
|
|
41
41
|
isDefault: boolean;
|
|
42
42
|
sortOrder: number;
|
|
43
43
|
} | undefined;
|
|
@@ -171,10 +171,10 @@ export declare const pipelineRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
171
171
|
input: {};
|
|
172
172
|
output: {
|
|
173
173
|
data: {
|
|
174
|
+
id: string;
|
|
174
175
|
name: string;
|
|
175
176
|
createdAt: string;
|
|
176
177
|
updatedAt: string;
|
|
177
|
-
id: string;
|
|
178
178
|
sortOrder: number;
|
|
179
179
|
pipelineId: string;
|
|
180
180
|
probability: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../src/routes/pipelines.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../src/routes/pipelines.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAajE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAiEvB,CAAA"}
|
package/dist/routes/pipelines.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { parseJsonBody, parseQuery } from "@voyantjs/hono";
|
|
1
2
|
import { Hono } from "hono";
|
|
2
3
|
import { crmService } from "../service/index.js";
|
|
3
4
|
import { insertPipelineSchema, insertStageSchema, pipelineListQuerySchema, stageListQuerySchema, updatePipelineSchema, updateStageSchema, } from "../validation.js";
|
|
4
5
|
export const pipelineRoutes = new Hono()
|
|
5
6
|
.get("/pipelines", async (c) => {
|
|
6
|
-
const query =
|
|
7
|
+
const query = await parseQuery(c, pipelineListQuerySchema);
|
|
7
8
|
return c.json(await crmService.listPipelines(c.get("db"), query));
|
|
8
9
|
})
|
|
9
10
|
.post("/pipelines", async (c) => {
|
|
10
11
|
return c.json({
|
|
11
|
-
data: await crmService.createPipeline(c.get("db"),
|
|
12
|
+
data: await crmService.createPipeline(c.get("db"), await parseJsonBody(c, insertPipelineSchema)),
|
|
12
13
|
}, 201);
|
|
13
14
|
})
|
|
14
15
|
.get("/pipelines/:id", async (c) => {
|
|
@@ -18,7 +19,7 @@ export const pipelineRoutes = new Hono()
|
|
|
18
19
|
return c.json({ data: row });
|
|
19
20
|
})
|
|
20
21
|
.patch("/pipelines/:id", async (c) => {
|
|
21
|
-
const row = await crmService.updatePipeline(c.get("db"), c.req.param("id"),
|
|
22
|
+
const row = await crmService.updatePipeline(c.get("db"), c.req.param("id"), await parseJsonBody(c, updatePipelineSchema));
|
|
22
23
|
if (!row)
|
|
23
24
|
return c.json({ error: "Pipeline not found" }, 404);
|
|
24
25
|
return c.json({ data: row });
|
|
@@ -30,12 +31,12 @@ export const pipelineRoutes = new Hono()
|
|
|
30
31
|
return c.json({ success: true });
|
|
31
32
|
})
|
|
32
33
|
.get("/stages", async (c) => {
|
|
33
|
-
const query =
|
|
34
|
+
const query = await parseQuery(c, stageListQuerySchema);
|
|
34
35
|
return c.json(await crmService.listStages(c.get("db"), query));
|
|
35
36
|
})
|
|
36
37
|
.post("/stages", async (c) => {
|
|
37
38
|
return c.json({
|
|
38
|
-
data: await crmService.createStage(c.get("db"),
|
|
39
|
+
data: await crmService.createStage(c.get("db"), await parseJsonBody(c, insertStageSchema)),
|
|
39
40
|
}, 201);
|
|
40
41
|
})
|
|
41
42
|
.get("/stages/:id", async (c) => {
|
|
@@ -45,7 +46,7 @@ export const pipelineRoutes = new Hono()
|
|
|
45
46
|
return c.json({ data: row });
|
|
46
47
|
})
|
|
47
48
|
.patch("/stages/:id", async (c) => {
|
|
48
|
-
const row = await crmService.updateStage(c.get("db"), c.req.param("id"),
|
|
49
|
+
const row = await crmService.updateStage(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateStageSchema));
|
|
49
50
|
if (!row)
|
|
50
51
|
return c.json({ error: "Stage not found" }, 404);
|
|
51
52
|
return c.json({ data: row });
|
package/dist/routes/quotes.d.ts
CHANGED
|
@@ -38,14 +38,14 @@ export declare const quoteRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
38
38
|
input: {};
|
|
39
39
|
output: {
|
|
40
40
|
data: {
|
|
41
|
-
|
|
41
|
+
id: string;
|
|
42
42
|
createdAt: string;
|
|
43
43
|
updatedAt: string;
|
|
44
|
-
notes: string | null;
|
|
45
|
-
id: string;
|
|
46
44
|
status: "archived" | "draft" | "sent" | "accepted" | "expired" | "rejected";
|
|
47
|
-
archivedAt: string | null;
|
|
48
45
|
currency: string;
|
|
46
|
+
notes: string | null;
|
|
47
|
+
opportunityId: string;
|
|
48
|
+
archivedAt: string | null;
|
|
49
49
|
validUntil: string | null;
|
|
50
50
|
subtotalAmountCents: number;
|
|
51
51
|
taxAmountCents: number;
|
|
@@ -197,16 +197,16 @@ export declare const quoteRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
197
197
|
};
|
|
198
198
|
output: {
|
|
199
199
|
data: {
|
|
200
|
-
|
|
200
|
+
id: string;
|
|
201
201
|
createdAt: string;
|
|
202
202
|
updatedAt: string;
|
|
203
|
+
currency: string;
|
|
203
204
|
description: string;
|
|
204
|
-
|
|
205
|
+
quoteId: string;
|
|
205
206
|
productId: string | null;
|
|
206
207
|
supplierServiceId: string | null;
|
|
207
208
|
quantity: number;
|
|
208
209
|
unitPriceAmountCents: number;
|
|
209
|
-
currency: string;
|
|
210
210
|
totalAmountCents: number;
|
|
211
211
|
} | undefined;
|
|
212
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../src/routes/quotes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../src/routes/quotes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAYjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA4DpB,CAAA"}
|
package/dist/routes/quotes.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { parseJsonBody, parseQuery } from "@voyantjs/hono";
|
|
1
2
|
import { Hono } from "hono";
|
|
2
3
|
import { crmService } from "../service/index.js";
|
|
3
4
|
import { insertQuoteLineSchema, insertQuoteSchema, quoteListQuerySchema, updateQuoteLineSchema, updateQuoteSchema, } from "../validation.js";
|
|
4
5
|
export const quoteRoutes = new Hono()
|
|
5
6
|
.get("/quotes", async (c) => {
|
|
6
|
-
const query =
|
|
7
|
+
const query = await parseQuery(c, quoteListQuerySchema);
|
|
7
8
|
return c.json(await crmService.listQuotes(c.get("db"), query));
|
|
8
9
|
})
|
|
9
10
|
.post("/quotes", async (c) => {
|
|
10
11
|
return c.json({
|
|
11
|
-
data: await crmService.createQuote(c.get("db"),
|
|
12
|
+
data: await crmService.createQuote(c.get("db"), await parseJsonBody(c, insertQuoteSchema)),
|
|
12
13
|
}, 201);
|
|
13
14
|
})
|
|
14
15
|
.get("/quotes/:id", async (c) => {
|
|
@@ -18,7 +19,7 @@ export const quoteRoutes = new Hono()
|
|
|
18
19
|
return c.json({ data: row });
|
|
19
20
|
})
|
|
20
21
|
.patch("/quotes/:id", async (c) => {
|
|
21
|
-
const row = await crmService.updateQuote(c.get("db"), c.req.param("id"),
|
|
22
|
+
const row = await crmService.updateQuote(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateQuoteSchema));
|
|
22
23
|
if (!row)
|
|
23
24
|
return c.json({ error: "Quote not found" }, 404);
|
|
24
25
|
return c.json({ data: row });
|
|
@@ -34,11 +35,11 @@ export const quoteRoutes = new Hono()
|
|
|
34
35
|
})
|
|
35
36
|
.post("/quotes/:id/lines", async (c) => {
|
|
36
37
|
return c.json({
|
|
37
|
-
data: await crmService.createQuoteLine(c.get("db"), c.req.param("id"),
|
|
38
|
+
data: await crmService.createQuoteLine(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertQuoteLineSchema)),
|
|
38
39
|
}, 201);
|
|
39
40
|
})
|
|
40
41
|
.patch("/quote-lines/:id", async (c) => {
|
|
41
|
-
const row = await crmService.updateQuoteLine(c.get("db"), c.req.param("id"),
|
|
42
|
+
const row = await crmService.updateQuoteLine(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateQuoteLineSchema));
|
|
42
43
|
if (!row)
|
|
43
44
|
return c.json({ error: "Quote line not found" }, 404);
|
|
44
45
|
return c.json({ data: row });
|
|
@@ -876,7 +876,7 @@ export declare const communicationLog: import("drizzle-orm/pg-core").PgTableWith
|
|
|
876
876
|
tableName: "communication_log";
|
|
877
877
|
dataType: "string";
|
|
878
878
|
columnType: "PgEnumColumn";
|
|
879
|
-
data: "email" | "
|
|
879
|
+
data: "email" | "other" | "phone" | "whatsapp" | "sms" | "meeting";
|
|
880
880
|
driverParam: string;
|
|
881
881
|
notNull: true;
|
|
882
882
|
hasDefault: false;
|
|
@@ -470,7 +470,7 @@ export declare const customFieldDefinitions: import("drizzle-orm/pg-core").PgTab
|
|
|
470
470
|
tableName: "custom_field_definitions";
|
|
471
471
|
dataType: "string";
|
|
472
472
|
columnType: "PgEnumColumn";
|
|
473
|
-
data: "boolean" | "json" | "date" | "
|
|
473
|
+
data: "boolean" | "json" | "date" | "set" | "enum" | "text" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
474
474
|
driverParam: string;
|
|
475
475
|
notNull: true;
|
|
476
476
|
hasDefault: false;
|
|
@@ -47,21 +47,21 @@ export declare const organizationAccountsService: {
|
|
|
47
47
|
archivedAt: Date | null;
|
|
48
48
|
} | null>;
|
|
49
49
|
createOrganization(db: PostgresJsDatabase, data: CreateOrganizationInput): Promise<{
|
|
50
|
+
source: string | null;
|
|
50
51
|
relation: "partner" | "supplier" | "other" | "client" | null;
|
|
52
|
+
id: string;
|
|
51
53
|
name: string;
|
|
52
54
|
createdAt: Date;
|
|
53
55
|
updatedAt: Date;
|
|
54
|
-
|
|
56
|
+
status: "active" | "inactive" | "archived";
|
|
55
57
|
notes: string | null;
|
|
56
|
-
|
|
58
|
+
website: string | null;
|
|
57
59
|
legalName: string | null;
|
|
58
60
|
industry: string | null;
|
|
59
61
|
ownerId: string | null;
|
|
60
62
|
defaultCurrency: string | null;
|
|
61
63
|
preferredLanguage: string | null;
|
|
62
64
|
paymentTerms: number | null;
|
|
63
|
-
status: "active" | "inactive" | "archived";
|
|
64
|
-
source: string | null;
|
|
65
65
|
sourceRef: string | null;
|
|
66
66
|
tags: string[];
|
|
67
67
|
archivedAt: Date | null;
|
|
@@ -93,7 +93,7 @@ export declare const peopleAccountsService: {
|
|
|
93
93
|
id: string;
|
|
94
94
|
entityType: string;
|
|
95
95
|
entityId: string;
|
|
96
|
-
kind: "email" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social"
|
|
96
|
+
kind: "email" | "other" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social";
|
|
97
97
|
label: string | null;
|
|
98
98
|
value: string;
|
|
99
99
|
normalizedValue: string | null;
|
|
@@ -105,23 +105,23 @@ export declare const peopleAccountsService: {
|
|
|
105
105
|
}[]>;
|
|
106
106
|
createContactMethod(db: PostgresJsDatabase, entityType: "organization" | "person", entityId: string, data: CreateContactPointInput): Promise<{
|
|
107
107
|
value: string;
|
|
108
|
+
metadata: Record<string, unknown> | null;
|
|
109
|
+
id: string;
|
|
108
110
|
createdAt: Date;
|
|
109
111
|
updatedAt: Date;
|
|
110
|
-
|
|
112
|
+
notes: string | null;
|
|
113
|
+
kind: "email" | "other" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social";
|
|
111
114
|
entityType: string;
|
|
112
115
|
entityId: string;
|
|
113
116
|
label: string | null;
|
|
114
117
|
normalizedValue: string | null;
|
|
115
118
|
isPrimary: boolean;
|
|
116
|
-
notes: string | null;
|
|
117
|
-
metadata: Record<string, unknown> | null;
|
|
118
|
-
id: string;
|
|
119
119
|
} | null>;
|
|
120
120
|
updateContactMethod(db: PostgresJsDatabase, id: string, data: UpdateContactPointInput): Promise<{
|
|
121
121
|
id: string;
|
|
122
122
|
entityType: string;
|
|
123
123
|
entityId: string;
|
|
124
|
-
kind: "email" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social"
|
|
124
|
+
kind: "email" | "other" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social";
|
|
125
125
|
label: string | null;
|
|
126
126
|
value: string;
|
|
127
127
|
normalizedValue: string | null;
|
|
@@ -138,7 +138,7 @@ export declare const peopleAccountsService: {
|
|
|
138
138
|
id: string;
|
|
139
139
|
entityType: string;
|
|
140
140
|
entityId: string;
|
|
141
|
-
label: "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "
|
|
141
|
+
label: "service" | "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
|
|
142
142
|
fullText: string | null;
|
|
143
143
|
line1: string | null;
|
|
144
144
|
line2: string | null;
|
|
@@ -156,14 +156,16 @@ export declare const peopleAccountsService: {
|
|
|
156
156
|
updatedAt: Date;
|
|
157
157
|
}[]>;
|
|
158
158
|
createAddress(db: PostgresJsDatabase, entityType: "organization" | "person", entityId: string, data: CreateAddressInput): Promise<{
|
|
159
|
+
metadata: Record<string, unknown> | null;
|
|
160
|
+
id: string;
|
|
159
161
|
createdAt: Date;
|
|
160
162
|
updatedAt: Date;
|
|
163
|
+
notes: string | null;
|
|
164
|
+
timezone: string | null;
|
|
161
165
|
entityType: string;
|
|
162
166
|
entityId: string;
|
|
163
|
-
label: "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "
|
|
167
|
+
label: "service" | "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
|
|
164
168
|
isPrimary: boolean;
|
|
165
|
-
notes: string | null;
|
|
166
|
-
metadata: Record<string, unknown> | null;
|
|
167
169
|
fullText: string | null;
|
|
168
170
|
line1: string | null;
|
|
169
171
|
line2: string | null;
|
|
@@ -173,14 +175,12 @@ export declare const peopleAccountsService: {
|
|
|
173
175
|
country: string | null;
|
|
174
176
|
latitude: number | null;
|
|
175
177
|
longitude: number | null;
|
|
176
|
-
timezone: string | null;
|
|
177
|
-
id: string;
|
|
178
178
|
} | null>;
|
|
179
179
|
updateAddress(db: PostgresJsDatabase, id: string, data: UpdateAddressInput): Promise<{
|
|
180
180
|
id: string;
|
|
181
181
|
entityType: string;
|
|
182
182
|
entityId: string;
|
|
183
|
-
label: "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "
|
|
183
|
+
label: "service" | "primary" | "other" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
|
|
184
184
|
fullText: string | null;
|
|
185
185
|
line1: string | null;
|
|
186
186
|
line2: string | null;
|
|
@@ -380,8 +380,8 @@ export declare const peopleAccountsService: {
|
|
|
380
380
|
}, {}, {}>;
|
|
381
381
|
}>, "where" | "orderBy">;
|
|
382
382
|
createPersonNote(db: PostgresJsDatabase, personId: string, userId: string, data: CreatePersonNoteInput): Promise<{
|
|
383
|
-
createdAt: Date;
|
|
384
383
|
id: string;
|
|
384
|
+
createdAt: Date;
|
|
385
385
|
personId: string;
|
|
386
386
|
authorId: string;
|
|
387
387
|
content: string;
|
|
@@ -566,8 +566,8 @@ export declare const peopleAccountsService: {
|
|
|
566
566
|
}, {}, {}>;
|
|
567
567
|
}>, "where" | "orderBy">;
|
|
568
568
|
createOrganizationNote(db: PostgresJsDatabase, organizationId: string, userId: string, data: CreateOrganizationNoteInput): Promise<{
|
|
569
|
-
createdAt: Date;
|
|
570
569
|
id: string;
|
|
570
|
+
createdAt: Date;
|
|
571
571
|
organizationId: string;
|
|
572
572
|
authorId: string;
|
|
573
573
|
content: string;
|
|
@@ -580,8 +580,8 @@ export declare const peopleAccountsService: {
|
|
|
580
580
|
createdAt: Date;
|
|
581
581
|
} | null>;
|
|
582
582
|
deletePersonNote(db: PostgresJsDatabase, id: string): Promise<{
|
|
583
|
-
createdAt: Date;
|
|
584
583
|
id: string;
|
|
584
|
+
createdAt: Date;
|
|
585
585
|
personId: string;
|
|
586
586
|
authorId: string;
|
|
587
587
|
content: string;
|
|
@@ -594,8 +594,8 @@ export declare const peopleAccountsService: {
|
|
|
594
594
|
createdAt: Date;
|
|
595
595
|
} | null>;
|
|
596
596
|
deleteOrganizationNote(db: PostgresJsDatabase, id: string): Promise<{
|
|
597
|
-
createdAt: Date;
|
|
598
597
|
id: string;
|
|
598
|
+
createdAt: Date;
|
|
599
599
|
organizationId: string;
|
|
600
600
|
authorId: string;
|
|
601
601
|
content: string;
|
|
@@ -604,7 +604,7 @@ export declare const peopleAccountsService: {
|
|
|
604
604
|
id: string;
|
|
605
605
|
personId: string;
|
|
606
606
|
organizationId: string | null;
|
|
607
|
-
channel: "email" | "
|
|
607
|
+
channel: "email" | "other" | "phone" | "whatsapp" | "sms" | "meeting";
|
|
608
608
|
direction: "inbound" | "outbound";
|
|
609
609
|
subject: string | null;
|
|
610
610
|
content: string | null;
|
|
@@ -612,12 +612,12 @@ export declare const peopleAccountsService: {
|
|
|
612
612
|
createdAt: Date;
|
|
613
613
|
}[]>;
|
|
614
614
|
createCommunication(db: PostgresJsDatabase, personId: string, data: CreateCommunicationLogInput): Promise<{
|
|
615
|
-
createdAt: Date;
|
|
616
615
|
id: string;
|
|
616
|
+
createdAt: Date;
|
|
617
617
|
organizationId: string | null;
|
|
618
618
|
personId: string;
|
|
619
619
|
content: string | null;
|
|
620
|
-
channel: "email" | "
|
|
620
|
+
channel: "email" | "other" | "phone" | "whatsapp" | "sms" | "meeting";
|
|
621
621
|
direction: "inbound" | "outbound";
|
|
622
622
|
subject: string | null;
|
|
623
623
|
sentAt: Date | null;
|
|
@@ -841,11 +841,11 @@ export declare const peopleAccountsService: {
|
|
|
841
841
|
}, {}, {}>;
|
|
842
842
|
}>, "orderBy">;
|
|
843
843
|
createSegment(db: PostgresJsDatabase, data: CreateSegmentInput): Promise<{
|
|
844
|
+
id: string;
|
|
844
845
|
name: string;
|
|
845
846
|
createdAt: Date;
|
|
846
847
|
updatedAt: Date;
|
|
847
848
|
description: string | null;
|
|
848
|
-
id: string;
|
|
849
849
|
conditions: Record<string, unknown> | null;
|
|
850
850
|
} | undefined>;
|
|
851
851
|
deleteSegment(db: PostgresJsDatabase, segmentId: string): Promise<{
|