@hed-hog/contact 0.0.294 → 0.0.295
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/person/dto/account.dto.d.ts +28 -0
- package/dist/person/dto/account.dto.d.ts.map +1 -0
- package/dist/person/dto/account.dto.js +123 -0
- package/dist/person/dto/account.dto.js.map +1 -0
- package/dist/person/dto/activity.dto.d.ts +15 -0
- package/dist/person/dto/activity.dto.d.ts.map +1 -0
- package/dist/person/dto/activity.dto.js +65 -0
- package/dist/person/dto/activity.dto.js.map +1 -0
- package/dist/person/dto/dashboard-query.dto.d.ts +9 -0
- package/dist/person/dto/dashboard-query.dto.d.ts.map +1 -0
- package/dist/person/dto/dashboard-query.dto.js +40 -0
- package/dist/person/dto/dashboard-query.dto.js.map +1 -0
- package/dist/person/dto/followup-query.dto.d.ts +10 -0
- package/dist/person/dto/followup-query.dto.d.ts.map +1 -0
- package/dist/person/dto/followup-query.dto.js +45 -0
- package/dist/person/dto/followup-query.dto.js.map +1 -0
- package/dist/person/person.controller.d.ts +204 -0
- package/dist/person/person.controller.d.ts.map +1 -1
- package/dist/person/person.controller.js +138 -0
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.service.d.ts +234 -0
- package/dist/person/person.service.d.ts.map +1 -1
- package/dist/person/person.service.js +1367 -0
- package/dist/person/person.service.js.map +1 -1
- package/hedhog/data/menu.yaml +163 -163
- package/hedhog/data/route.yaml +41 -0
- package/hedhog/frontend/app/accounts/_components/account-form-sheet.tsx.ejs +210 -114
- package/hedhog/frontend/app/accounts/_components/account-types.ts.ejs +3 -0
- package/hedhog/frontend/app/accounts/page.tsx.ejs +323 -245
- package/hedhog/frontend/app/activities/_components/activity-detail-sheet.tsx.ejs +240 -0
- package/hedhog/frontend/app/activities/_components/activity-types.ts.ejs +66 -0
- package/hedhog/frontend/app/activities/page.tsx.ejs +165 -517
- package/hedhog/frontend/app/dashboard/_components/dashboard-types.ts.ejs +70 -0
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +504 -356
- package/hedhog/frontend/app/follow-ups/page.tsx.ejs +242 -153
- package/hedhog/frontend/messages/en.json +91 -6
- package/hedhog/frontend/messages/pt.json +91 -6
- package/hedhog/table/crm_activity.yaml +68 -0
- package/hedhog/table/person_company.yaml +22 -0
- package/package.json +4 -4
- package/src/person/dto/account.dto.ts +100 -0
- package/src/person/dto/activity.dto.ts +54 -0
- package/src/person/dto/dashboard-query.dto.ts +25 -0
- package/src/person/dto/followup-query.dto.ts +25 -0
- package/src/person/person.controller.ts +116 -0
- package/src/person/person.service.ts +2139 -77
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PersonStatus } from './create.dto';
|
|
2
|
+
export declare const ACCOUNT_LIFECYCLE_STAGES: readonly ["prospect", "customer", "churned", "inactive"];
|
|
3
|
+
export type AccountLifecycleStage = (typeof ACCOUNT_LIFECYCLE_STAGES)[number];
|
|
4
|
+
export declare class AccountListQueryDTO {
|
|
5
|
+
search?: string;
|
|
6
|
+
status?: 'all' | PersonStatus;
|
|
7
|
+
lifecycle_stage?: 'all' | AccountLifecycleStage;
|
|
8
|
+
sortField?: 'name' | 'created_at';
|
|
9
|
+
sortOrder?: 'asc' | 'desc';
|
|
10
|
+
}
|
|
11
|
+
export declare class CreateAccountDTO {
|
|
12
|
+
name: string;
|
|
13
|
+
trade_name?: string | null;
|
|
14
|
+
status: PersonStatus;
|
|
15
|
+
industry?: string | null;
|
|
16
|
+
website?: string | null;
|
|
17
|
+
email?: string | null;
|
|
18
|
+
phone?: string | null;
|
|
19
|
+
owner_user_id?: number | null;
|
|
20
|
+
annual_revenue?: number | null;
|
|
21
|
+
employee_count?: number | null;
|
|
22
|
+
lifecycle_stage?: AccountLifecycleStage | null;
|
|
23
|
+
city?: string | null;
|
|
24
|
+
state?: string | null;
|
|
25
|
+
}
|
|
26
|
+
export declare class UpdateAccountDTO extends CreateAccountDTO {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=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gB;CAAG"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateAccountDTO = exports.CreateAccountDTO = exports.AccountListQueryDTO = exports.ACCOUNT_LIFECYCLE_STAGES = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const create_dto_1 = require("./create.dto");
|
|
16
|
+
exports.ACCOUNT_LIFECYCLE_STAGES = [
|
|
17
|
+
'prospect',
|
|
18
|
+
'customer',
|
|
19
|
+
'churned',
|
|
20
|
+
'inactive',
|
|
21
|
+
];
|
|
22
|
+
class AccountListQueryDTO {
|
|
23
|
+
}
|
|
24
|
+
exports.AccountListQueryDTO = AccountListQueryDTO;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], AccountListQueryDTO.prototype, "search", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsIn)(['all', create_dto_1.PersonStatus.ACTIVE, create_dto_1.PersonStatus.INACTIVE]),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], AccountListQueryDTO.prototype, "status", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsIn)(['all', ...exports.ACCOUNT_LIFECYCLE_STAGES]),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], AccountListQueryDTO.prototype, "lifecycle_stage", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsIn)(['name', 'created_at']),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AccountListQueryDTO.prototype, "sortField", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsIn)(['asc', 'desc']),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], AccountListQueryDTO.prototype, "sortOrder", void 0);
|
|
50
|
+
class CreateAccountDTO {
|
|
51
|
+
}
|
|
52
|
+
exports.CreateAccountDTO = CreateAccountDTO;
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], CreateAccountDTO.prototype, "name", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CreateAccountDTO.prototype, "trade_name", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsIn)([create_dto_1.PersonStatus.ACTIVE, create_dto_1.PersonStatus.INACTIVE]),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CreateAccountDTO.prototype, "status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.IsString)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], CreateAccountDTO.prototype, "industry", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsOptional)(),
|
|
73
|
+
(0, class_validator_1.IsString)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], CreateAccountDTO.prototype, "website", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.IsEmail)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], CreateAccountDTO.prototype, "email", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsOptional)(),
|
|
83
|
+
(0, class_validator_1.IsString)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], CreateAccountDTO.prototype, "phone", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
89
|
+
(0, class_validator_1.IsInt)(),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], CreateAccountDTO.prototype, "owner_user_id", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, class_validator_1.IsOptional)(),
|
|
94
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
95
|
+
(0, class_validator_1.IsNumber)(),
|
|
96
|
+
__metadata("design:type", Number)
|
|
97
|
+
], CreateAccountDTO.prototype, "annual_revenue", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.IsOptional)(),
|
|
100
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
101
|
+
(0, class_validator_1.IsInt)(),
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
|
+
], CreateAccountDTO.prototype, "employee_count", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsOptional)(),
|
|
106
|
+
(0, class_validator_1.IsIn)(exports.ACCOUNT_LIFECYCLE_STAGES),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], CreateAccountDTO.prototype, "lifecycle_stage", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, class_validator_1.IsOptional)(),
|
|
111
|
+
(0, class_validator_1.IsString)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], CreateAccountDTO.prototype, "city", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
|
+
(0, class_validator_1.IsString)(),
|
|
117
|
+
(0, class_validator_1.MaxLength)(2),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], CreateAccountDTO.prototype, "state", void 0);
|
|
120
|
+
class UpdateAccountDTO extends CreateAccountDTO {
|
|
121
|
+
}
|
|
122
|
+
exports.UpdateAccountDTO = UpdateAccountDTO;
|
|
123
|
+
//# sourceMappingURL=account.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.dto.js","sourceRoot":"","sources":["../../../src/person/dto/account.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAQyB;AACzB,6CAA4C;AAE/B,QAAA,wBAAwB,GAAG;IACtC,UAAU;IACV,UAAU;IACV,SAAS;IACT,UAAU;CACF,CAAC;AAIX,MAAa,mBAAmB;CAoB/B;AApBD,kDAoBC;AAjBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,yBAAY,CAAC,MAAM,EAAE,yBAAY,CAAC,QAAQ,CAAC,CAAC;;mDAC5B;AAI9B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,GAAG,gCAAwB,CAAC,CAAC;;4DACK;AAIh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B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;+CACS;AAGxB,MAAa,gBAAiB,SAAQ,gBAAgB;CAAG;AAAzD,4CAAyD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const CRM_ACTIVITY_TYPES: readonly ["call", "email", "meeting", "whatsapp", "task", "note"];
|
|
2
|
+
export declare const CRM_ACTIVITY_PRIORITIES: readonly ["high", "medium", "low"];
|
|
3
|
+
export declare const CRM_ACTIVITY_STATUSES: readonly ["pending", "overdue", "completed"];
|
|
4
|
+
export declare const CRM_ACTIVITY_SOURCE_KINDS: readonly ["manual", "followup", "interaction"];
|
|
5
|
+
export type CrmActivityType = (typeof CRM_ACTIVITY_TYPES)[number];
|
|
6
|
+
export type CrmActivityPriority = (typeof CRM_ACTIVITY_PRIORITIES)[number];
|
|
7
|
+
export type CrmActivityStatus = (typeof CRM_ACTIVITY_STATUSES)[number];
|
|
8
|
+
export type CrmActivitySourceKind = (typeof CRM_ACTIVITY_SOURCE_KINDS)[number];
|
|
9
|
+
export declare class ActivityListQueryDTO {
|
|
10
|
+
search?: string;
|
|
11
|
+
status?: 'all' | CrmActivityStatus;
|
|
12
|
+
type?: 'all' | CrmActivityType;
|
|
13
|
+
priority?: 'all' | CrmActivityPriority;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=activity.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.dto.d.ts","sourceRoot":"","sources":["../../../src/person/dto/activity.dto.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,mEAOrB,CAAC;AAEX,eAAO,MAAM,uBAAuB,oCAAqC,CAAC;AAC1E,eAAO,MAAM,qBAAqB,8CAIxB,CAAC;AACX,eAAO,MAAM,yBAAyB,gDAI5B,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,qBAAa,oBAAoB;IAK/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,MAAM,CAAC,EAAE,KAAK,GAAG,iBAAiB,CAAC;IAMnC,IAAI,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC;IAM/B,QAAQ,CAAC,EAAE,KAAK,GAAG,mBAAmB,CAAC;CACxC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ActivityListQueryDTO = exports.CRM_ACTIVITY_SOURCE_KINDS = exports.CRM_ACTIVITY_STATUSES = exports.CRM_ACTIVITY_PRIORITIES = exports.CRM_ACTIVITY_TYPES = void 0;
|
|
13
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
exports.CRM_ACTIVITY_TYPES = [
|
|
16
|
+
'call',
|
|
17
|
+
'email',
|
|
18
|
+
'meeting',
|
|
19
|
+
'whatsapp',
|
|
20
|
+
'task',
|
|
21
|
+
'note',
|
|
22
|
+
];
|
|
23
|
+
exports.CRM_ACTIVITY_PRIORITIES = ['high', 'medium', 'low'];
|
|
24
|
+
exports.CRM_ACTIVITY_STATUSES = [
|
|
25
|
+
'pending',
|
|
26
|
+
'overdue',
|
|
27
|
+
'completed',
|
|
28
|
+
];
|
|
29
|
+
exports.CRM_ACTIVITY_SOURCE_KINDS = [
|
|
30
|
+
'manual',
|
|
31
|
+
'followup',
|
|
32
|
+
'interaction',
|
|
33
|
+
];
|
|
34
|
+
class ActivityListQueryDTO {
|
|
35
|
+
}
|
|
36
|
+
exports.ActivityListQueryDTO = ActivityListQueryDTO;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsString)({
|
|
40
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value),
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ActivityListQueryDTO.prototype, "search", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsIn)(['all', ...exports.CRM_ACTIVITY_STATUSES], {
|
|
47
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.typeMustBeEnum', args.value),
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ActivityListQueryDTO.prototype, "status", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsIn)(['all', ...exports.CRM_ACTIVITY_TYPES], {
|
|
54
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.typeMustBeEnum', args.value),
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ActivityListQueryDTO.prototype, "type", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsIn)(['all', ...exports.CRM_ACTIVITY_PRIORITIES], {
|
|
61
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.typeMustBeEnum', args.value),
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], ActivityListQueryDTO.prototype, "priority", void 0);
|
|
65
|
+
//# sourceMappingURL=activity.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.dto.js","sourceRoot":"","sources":["../../../src/person/dto/activity.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAA6D;AAEhD,QAAA,kBAAkB,GAAG;IAChC,MAAM;IACN,OAAO;IACP,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;CACE,CAAC;AAEE,QAAA,uBAAuB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAC7D,QAAA,qBAAqB,GAAG;IACnC,SAAS;IACT,SAAS;IACT,WAAW;CACH,CAAC;AACE,QAAA,yBAAyB,GAAG;IACvC,QAAQ;IACR,UAAU;IACV,aAAa;CACL,CAAC;AAOX,MAAa,oBAAoB;CAwBhC;AAxBD,oDAwBC;AAnBC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;oDACc;AAMhB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,GAAG,6BAAqB,CAAC,EAAE;QACvC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;oDACiC;AAMnC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,GAAG,0BAAkB,CAAC,EAAE;QACpC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;kDAC6B;AAM/B;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,GAAG,+BAAuB,CAAC,EAAE;QACzC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;sDACqC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CRM_DASHBOARD_PERIODS: readonly ["7d", "30d", "90d", "custom"];
|
|
2
|
+
export type CrmDashboardPeriod = (typeof CRM_DASHBOARD_PERIODS)[number];
|
|
3
|
+
export declare class DashboardQueryDTO {
|
|
4
|
+
owner_user_id?: number;
|
|
5
|
+
period?: CrmDashboardPeriod;
|
|
6
|
+
date_from?: string;
|
|
7
|
+
date_to?: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=dashboard-query.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-query.dto.d.ts","sourceRoot":"","sources":["../../../src/person/dto/dashboard-query.dto.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,yCAA0C,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,qBAAa,iBAAiB;IAI5B,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAI5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DashboardQueryDTO = exports.CRM_DASHBOARD_PERIODS = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
exports.CRM_DASHBOARD_PERIODS = ['7d', '30d', '90d', 'custom'];
|
|
16
|
+
class DashboardQueryDTO {
|
|
17
|
+
}
|
|
18
|
+
exports.DashboardQueryDTO = DashboardQueryDTO;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsOptional)(),
|
|
21
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
22
|
+
(0, class_validator_1.IsInt)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], DashboardQueryDTO.prototype, "owner_user_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsIn)(exports.CRM_DASHBOARD_PERIODS),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], DashboardQueryDTO.prototype, "period", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsDateString)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], DashboardQueryDTO.prototype, "date_from", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsDateString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], DashboardQueryDTO.prototype, "date_to", void 0);
|
|
40
|
+
//# sourceMappingURL=dashboard-query.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-query.dto.js","sourceRoot":"","sources":["../../../src/person/dto/dashboard-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAwE;AAE3D,QAAA,qBAAqB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAI7E,MAAa,iBAAiB;CAiB7B;AAjBD,8CAiBC;AAbC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;;wDACe;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,6BAAqB,CAAC;;iDACA;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;oDACI;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;kDACE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class FollowupListQueryDTO {
|
|
2
|
+
search?: string;
|
|
3
|
+
status?: 'all' | 'today' | 'upcoming' | 'overdue';
|
|
4
|
+
date_from?: string;
|
|
5
|
+
date_to?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class FollowupStatsQueryDTO {
|
|
8
|
+
search?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=followup-query.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-query.dto.d.ts","sourceRoot":"","sources":["../../../src/person/dto/followup-query.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,oBAAoB;IAG/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;IAIlD,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,qBAAqB;IAGhC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FollowupStatsQueryDTO = exports.FollowupListQueryDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class FollowupListQueryDTO {
|
|
15
|
+
}
|
|
16
|
+
exports.FollowupListQueryDTO = FollowupListQueryDTO;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], FollowupListQueryDTO.prototype, "search", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsIn)(['all', 'today', 'upcoming', 'overdue']),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], FollowupListQueryDTO.prototype, "status", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], FollowupListQueryDTO.prototype, "date_from", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], FollowupListQueryDTO.prototype, "date_to", void 0);
|
|
37
|
+
class FollowupStatsQueryDTO {
|
|
38
|
+
}
|
|
39
|
+
exports.FollowupStatsQueryDTO = FollowupStatsQueryDTO;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], FollowupStatsQueryDTO.prototype, "search", void 0);
|
|
45
|
+
//# sourceMappingURL=followup-query.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followup-query.dto.js","sourceRoot":"","sources":["../../../src/person/dto/followup-query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsE;AAEtE,MAAa,oBAAoB;CAgBhC;AAhBD,oDAgBC;AAbC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;;oDACI;AAIlD;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,qBAAqB,CAAC;;uDACZ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,qBAAqB,CAAC;;qDACd;AAGnB,MAAa,qBAAqB;CAIjC;AAJD,sDAIC;AADC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACK"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DeleteDTO } from '@hed-hog/api';
|
|
2
2
|
import { Response } from 'express';
|
|
3
|
+
import { AccountListQueryDTO, CreateAccountDTO, UpdateAccountDTO } from './dto/account.dto';
|
|
4
|
+
import { ActivityListQueryDTO } from './dto/activity.dto';
|
|
3
5
|
import { CreateFollowupDTO } from './dto/create-followup.dto';
|
|
4
6
|
import { CreateInteractionDTO } from './dto/create-interaction.dto';
|
|
5
7
|
import { CreateDTO } from './dto/create.dto';
|
|
8
|
+
import { DashboardQueryDTO } from './dto/dashboard-query.dto';
|
|
6
9
|
import { CheckPersonDuplicatesQueryDTO } from './dto/duplicates-query.dto';
|
|
10
|
+
import { FollowupListQueryDTO, FollowupStatsQueryDTO } from './dto/followup-query.dto';
|
|
7
11
|
import { MergePersonDTO } from './dto/merge.dto';
|
|
8
12
|
import { UpdateLifecycleStageDTO } from './dto/update-lifecycle-stage.dto';
|
|
9
13
|
import { UpdateAllPersonDTO } from './dto/update.dto';
|
|
@@ -18,6 +22,63 @@ export declare class PersonController {
|
|
|
18
22
|
active: number;
|
|
19
23
|
inactive: number;
|
|
20
24
|
}>;
|
|
25
|
+
getDashboard(query: DashboardQueryDTO, locale: string): Promise<{
|
|
26
|
+
kpis: {
|
|
27
|
+
total_leads: number;
|
|
28
|
+
qualified: number;
|
|
29
|
+
proposal: number;
|
|
30
|
+
customers: number;
|
|
31
|
+
lost: number;
|
|
32
|
+
unassigned: number;
|
|
33
|
+
overdue: number;
|
|
34
|
+
next_actions: number;
|
|
35
|
+
};
|
|
36
|
+
charts: {
|
|
37
|
+
stage: Array<{
|
|
38
|
+
key: "new" | "customer" | "contacted" | "qualified" | "proposal" | "negotiation" | "lost";
|
|
39
|
+
total: number;
|
|
40
|
+
}>;
|
|
41
|
+
source: Array<{
|
|
42
|
+
key: "other" | "social" | "website" | "inbound" | "outbound" | "referral";
|
|
43
|
+
total: number;
|
|
44
|
+
}>;
|
|
45
|
+
owner_performance: {
|
|
46
|
+
owner_user_id: number;
|
|
47
|
+
owner_name: string;
|
|
48
|
+
leads: number;
|
|
49
|
+
customers: number;
|
|
50
|
+
pipeline_value: number;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
lists: {
|
|
54
|
+
next_actions: {
|
|
55
|
+
id: number;
|
|
56
|
+
name: string;
|
|
57
|
+
trade_name: string | null;
|
|
58
|
+
owner_user: {
|
|
59
|
+
id: number;
|
|
60
|
+
name: string;
|
|
61
|
+
} | null;
|
|
62
|
+
source: "other" | "social" | "website" | "inbound" | "outbound" | "referral";
|
|
63
|
+
lifecycle_stage: "new" | "customer" | "contacted" | "qualified" | "proposal" | "negotiation" | "lost";
|
|
64
|
+
next_action_at?: string;
|
|
65
|
+
created_at?: string;
|
|
66
|
+
}[];
|
|
67
|
+
unattended: {
|
|
68
|
+
id: number;
|
|
69
|
+
name: string;
|
|
70
|
+
trade_name: string | null;
|
|
71
|
+
owner_user: {
|
|
72
|
+
id: number;
|
|
73
|
+
name: string;
|
|
74
|
+
} | null;
|
|
75
|
+
source: "other" | "social" | "website" | "inbound" | "outbound" | "referral";
|
|
76
|
+
lifecycle_stage: "new" | "customer" | "contacted" | "qualified" | "proposal" | "negotiation" | "lost";
|
|
77
|
+
next_action_at?: string;
|
|
78
|
+
created_at?: string;
|
|
79
|
+
}[];
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
21
82
|
getOwnerOptions(user: any): Promise<{
|
|
22
83
|
id: number;
|
|
23
84
|
name: string;
|
|
@@ -39,6 +100,149 @@ export declare class PersonController {
|
|
|
39
100
|
next: number;
|
|
40
101
|
data: any[];
|
|
41
102
|
}>;
|
|
103
|
+
listAccounts(paginationParams: any, query: AccountListQueryDTO): Promise<{
|
|
104
|
+
total: number;
|
|
105
|
+
lastPage: number;
|
|
106
|
+
page: number;
|
|
107
|
+
pageSize: number;
|
|
108
|
+
prev: number;
|
|
109
|
+
next: any;
|
|
110
|
+
data: {
|
|
111
|
+
id: number;
|
|
112
|
+
name: string;
|
|
113
|
+
trade_name: string | null;
|
|
114
|
+
status: "active" | "inactive";
|
|
115
|
+
industry: string | null;
|
|
116
|
+
website: string | null;
|
|
117
|
+
email: string | null;
|
|
118
|
+
phone: string | null;
|
|
119
|
+
owner_user_id: number | null;
|
|
120
|
+
owner_user: {
|
|
121
|
+
id: number;
|
|
122
|
+
name: string;
|
|
123
|
+
} | null;
|
|
124
|
+
annual_revenue: number | null;
|
|
125
|
+
employee_count: number | null;
|
|
126
|
+
lifecycle_stage: import("./dto/account.dto").AccountLifecycleStage | null;
|
|
127
|
+
city: string | null;
|
|
128
|
+
state: string | null;
|
|
129
|
+
created_at: string;
|
|
130
|
+
last_interaction_at: string | null;
|
|
131
|
+
}[];
|
|
132
|
+
}>;
|
|
133
|
+
getAccountStats(): Promise<{
|
|
134
|
+
total: number;
|
|
135
|
+
active: number;
|
|
136
|
+
customers: number;
|
|
137
|
+
prospects: number;
|
|
138
|
+
}>;
|
|
139
|
+
createAccount(data: CreateAccountDTO, locale: string): Promise<{
|
|
140
|
+
success: boolean;
|
|
141
|
+
id: number;
|
|
142
|
+
}>;
|
|
143
|
+
updateAccount(id: number, data: UpdateAccountDTO, locale: string): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
id: number;
|
|
146
|
+
}>;
|
|
147
|
+
deleteAccounts(data: DeleteDTO, locale: string): Promise<[import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload, import(".prisma/client").Prisma.BatchPayload]>;
|
|
148
|
+
listFollowups(paginationParams: any, query: FollowupListQueryDTO, user: any): Promise<{
|
|
149
|
+
total: number;
|
|
150
|
+
lastPage: number;
|
|
151
|
+
page: number;
|
|
152
|
+
pageSize: number;
|
|
153
|
+
prev: number;
|
|
154
|
+
next: any;
|
|
155
|
+
data: {
|
|
156
|
+
person: any;
|
|
157
|
+
next_action_at: string;
|
|
158
|
+
last_interaction_at: string | null;
|
|
159
|
+
status: "overdue" | "today" | "upcoming";
|
|
160
|
+
}[];
|
|
161
|
+
}>;
|
|
162
|
+
getFollowupStats(query: FollowupStatsQueryDTO, user: any): Promise<{
|
|
163
|
+
total: number;
|
|
164
|
+
today: number;
|
|
165
|
+
overdue: number;
|
|
166
|
+
upcoming: number;
|
|
167
|
+
}>;
|
|
168
|
+
listActivities(paginationParams: any, query: ActivityListQueryDTO): Promise<{
|
|
169
|
+
total: number;
|
|
170
|
+
lastPage: number;
|
|
171
|
+
page: number;
|
|
172
|
+
pageSize: number;
|
|
173
|
+
prev: number;
|
|
174
|
+
next: any;
|
|
175
|
+
data: {
|
|
176
|
+
id: number;
|
|
177
|
+
person_id: number;
|
|
178
|
+
person: {
|
|
179
|
+
id: number;
|
|
180
|
+
name: string;
|
|
181
|
+
type: "individual" | "company";
|
|
182
|
+
status: "active" | "inactive";
|
|
183
|
+
trade_name: string | null;
|
|
184
|
+
};
|
|
185
|
+
owner_user_id: number | null;
|
|
186
|
+
owner_user: {
|
|
187
|
+
id: number;
|
|
188
|
+
name: string;
|
|
189
|
+
} | null;
|
|
190
|
+
type: import("./dto/activity.dto").CrmActivityType;
|
|
191
|
+
subject: string;
|
|
192
|
+
notes: string | null;
|
|
193
|
+
due_at: string;
|
|
194
|
+
completed_at: string | null;
|
|
195
|
+
created_at: string;
|
|
196
|
+
priority: import("./dto/activity.dto").CrmActivityPriority;
|
|
197
|
+
status: import("./dto/activity.dto").CrmActivityStatus;
|
|
198
|
+
}[];
|
|
199
|
+
}>;
|
|
200
|
+
getActivityStats(): Promise<{
|
|
201
|
+
total: number;
|
|
202
|
+
pending: number;
|
|
203
|
+
overdue: number;
|
|
204
|
+
completed: number;
|
|
205
|
+
}>;
|
|
206
|
+
getActivity(id: number, locale: string): Promise<{
|
|
207
|
+
id: number;
|
|
208
|
+
person_id: number;
|
|
209
|
+
person: {
|
|
210
|
+
id: number;
|
|
211
|
+
name: string;
|
|
212
|
+
type: "individual" | "company";
|
|
213
|
+
status: "active" | "inactive";
|
|
214
|
+
trade_name: string | null;
|
|
215
|
+
};
|
|
216
|
+
owner_user_id: number | null;
|
|
217
|
+
owner_user: {
|
|
218
|
+
id: number;
|
|
219
|
+
name: string;
|
|
220
|
+
} | null;
|
|
221
|
+
type: import("./dto/activity.dto").CrmActivityType;
|
|
222
|
+
subject: string;
|
|
223
|
+
notes: string | null;
|
|
224
|
+
due_at: string;
|
|
225
|
+
completed_at: string | null;
|
|
226
|
+
created_at: string;
|
|
227
|
+
priority: import("./dto/activity.dto").CrmActivityPriority;
|
|
228
|
+
status: import("./dto/activity.dto").CrmActivityStatus;
|
|
229
|
+
} & {
|
|
230
|
+
source_kind: import("./dto/activity.dto").CrmActivitySourceKind;
|
|
231
|
+
created_by_user_id: number | null;
|
|
232
|
+
created_by_user: {
|
|
233
|
+
id: number;
|
|
234
|
+
name: string;
|
|
235
|
+
} | null;
|
|
236
|
+
completed_by_user_id: number | null;
|
|
237
|
+
completed_by_user: {
|
|
238
|
+
id: number;
|
|
239
|
+
name: string;
|
|
240
|
+
} | null;
|
|
241
|
+
}>;
|
|
242
|
+
completeActivity(id: number, locale: string, user: any): Promise<{
|
|
243
|
+
success: boolean;
|
|
244
|
+
completed_at: string;
|
|
245
|
+
}>;
|
|
42
246
|
openAvatar(id: number, res: Response, locale: string): Promise<void>;
|
|
43
247
|
get(id: number, locale: string): Promise<{
|
|
44
248
|
id: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.controller.d.ts","sourceRoot":"","sources":["../../src/person/person.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,cAAc,CAAC;AAiB7D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAEa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,QAAQ;;;;;;;IAKR,eAAe,CAAS,IAAI,KAAA;;;;IAK5B,eAAe,CAAU,KAAK,EAAE,6BAA6B;;;;;;;;IAK7D,IAAI,CAAe,gBAAgB,KAAA,EAAW,OAAO,KAAA,EAAU,IAAI,KAAA;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"person.controller.d.ts","sourceRoot":"","sources":["../../src/person/person.controller.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