@hed-hog/contact-us 0.0.1 → 0.0.3
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/contact-us.controller.d.ts +72 -6
- package/dist/contact-us.controller.d.ts.map +1 -1
- package/dist/contact-us.module.d.ts.map +1 -1
- package/dist/contact-us.module.js +5 -1
- package/dist/contact-us.module.js.map +1 -1
- package/dist/contact-us.service.d.ts +74 -8
- package/dist/contact-us.service.d.ts.map +1 -1
- package/dist/contact-us.service.js +9 -2
- package/dist/contact-us.service.js.map +1 -1
- package/hedhog/table/contact_us.yaml +1 -1
- package/package.json +4 -4
- package/src/contact-us.module.ts +5 -1
- package/src/contact-us.service.ts +9 -5
|
@@ -7,26 +7,92 @@ export declare class ContactUsController {
|
|
|
7
7
|
constructor(contactUsService: ContactUsService);
|
|
8
8
|
getContactUsSettings(): Promise<Record<string, any>>;
|
|
9
9
|
getUserStats(): Promise<{
|
|
10
|
-
total:
|
|
10
|
+
total: number;
|
|
11
11
|
totalNew: any;
|
|
12
12
|
totalResponded: any;
|
|
13
13
|
totalProgress: any;
|
|
14
|
+
totalArchived: any;
|
|
15
|
+
}>;
|
|
16
|
+
getContactUsMessage(id: number): Promise<{
|
|
17
|
+
user_contact_us_response_idTouser: {
|
|
18
|
+
name: string;
|
|
19
|
+
id: number;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
photo_id: number | null;
|
|
23
|
+
suspended_until: Date | null;
|
|
24
|
+
suspended_reason: string | null;
|
|
25
|
+
deactivated_at: Date | null;
|
|
26
|
+
};
|
|
27
|
+
user_contact_us_user_idTouser: {
|
|
28
|
+
name: string;
|
|
29
|
+
id: number;
|
|
30
|
+
created_at: Date;
|
|
31
|
+
updated_at: Date;
|
|
32
|
+
photo_id: number | null;
|
|
33
|
+
suspended_until: Date | null;
|
|
34
|
+
suspended_reason: string | null;
|
|
35
|
+
deactivated_at: Date | null;
|
|
36
|
+
};
|
|
37
|
+
} & {
|
|
38
|
+
name: string;
|
|
39
|
+
response: string | null;
|
|
40
|
+
id: number;
|
|
41
|
+
message: string;
|
|
42
|
+
created_at: Date;
|
|
43
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
44
|
+
email: string;
|
|
45
|
+
response_at: Date | null;
|
|
46
|
+
user_id: number | null;
|
|
47
|
+
response_id: number | null;
|
|
14
48
|
}>;
|
|
15
|
-
getContactUsMessage(id: number): Promise<any>;
|
|
16
49
|
getContactUsMessages(paginationParams: any, { status }: {
|
|
17
50
|
status: any;
|
|
18
51
|
}): Promise<{
|
|
19
52
|
data: any[];
|
|
20
|
-
total:
|
|
53
|
+
total: number;
|
|
21
54
|
page: number;
|
|
22
55
|
pageSize: any;
|
|
23
56
|
prev: number;
|
|
24
57
|
next: number;
|
|
25
58
|
lastPage: number;
|
|
26
59
|
}>;
|
|
27
|
-
deleteContactUsMessage(id: number): Promise<
|
|
28
|
-
|
|
60
|
+
deleteContactUsMessage(id: number): Promise<{
|
|
61
|
+
name: string;
|
|
62
|
+
response: string | null;
|
|
63
|
+
id: number;
|
|
64
|
+
message: string;
|
|
65
|
+
created_at: Date;
|
|
66
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
67
|
+
email: string;
|
|
68
|
+
response_at: Date | null;
|
|
69
|
+
user_id: number | null;
|
|
70
|
+
response_id: number | null;
|
|
71
|
+
}>;
|
|
72
|
+
updateContactUsMessageStatus(id: number, { status }: ContactUsStatusDTO): Promise<{
|
|
73
|
+
name: string;
|
|
74
|
+
response: string | null;
|
|
75
|
+
id: number;
|
|
76
|
+
message: string;
|
|
77
|
+
created_at: Date;
|
|
78
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
79
|
+
email: string;
|
|
80
|
+
response_at: Date | null;
|
|
81
|
+
user_id: number | null;
|
|
82
|
+
response_id: number | null;
|
|
83
|
+
}>;
|
|
29
84
|
respondToContactUsMessage(locale: string, id: number, { response }: ContactUsResponseDTO, user: any): Promise<string>;
|
|
30
|
-
createContactUsMessage(locale: string, { name, email, message }: ContactUsSendDTO): Promise<
|
|
85
|
+
createContactUsMessage(locale: string, { name, email, message }: ContactUsSendDTO): Promise<{
|
|
86
|
+
name: string;
|
|
87
|
+
response: string | null;
|
|
88
|
+
id: number;
|
|
89
|
+
message: string;
|
|
90
|
+
created_at: Date;
|
|
91
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
92
|
+
email: string;
|
|
93
|
+
response_at: Date | null;
|
|
94
|
+
user_id: number | null;
|
|
95
|
+
response_id: number | null;
|
|
96
|
+
}>;
|
|
31
97
|
}
|
|
32
98
|
//# sourceMappingURL=contact-us.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-us.controller.d.ts","sourceRoot":"","sources":["../src/contact-us.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,qBACa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAK/C,oBAAoB;IAKpB,YAAY
|
|
1
|
+
{"version":3,"file":"contact-us.controller.d.ts","sourceRoot":"","sources":["../src/contact-us.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,qBACa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAK/C,oBAAoB;IAKpB,YAAY;;;;;;;IAKZ,mBAAmB,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKzD,oBAAoB,CAAe,gBAAgB,KAAA,EAAW,EAAE,MAAM,EAAE;;KAAA;;;;;;;;;IAKxE,sBAAsB,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;IAK5D,4BAA4B,CACL,EAAE,EAAE,MAAM,EAC7B,EAAE,MAAM,EAAE,EAAE,kBAAkB;;;;;;;;;;;;IAMlC,yBAAyB,CACnB,MAAM,EAAE,MAAM,EACG,EAAE,EAAE,MAAM,EAC7B,EAAE,QAAQ,EAAE,EAAE,oBAAoB,EAClC,IAAI,KAAA;IAOR,sBAAsB,CAChB,MAAM,EAAE,MAAM,EAChB,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,gBAAgB;;;;;;;;;;;;CAIrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-us.module.d.ts","sourceRoot":"","sources":["../src/contact-us.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contact-us.module.d.ts","sourceRoot":"","sources":["../src/contact-us.module.ts"],"names":[],"mappings":"AASA,qBAaa,eAAe;CAAG"}
|
|
@@ -8,6 +8,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ContactUsModule = void 0;
|
|
10
10
|
const admin_1 = require("@hed-hog/admin");
|
|
11
|
+
const mail_module_1 = require("@hed-hog/admin/mail/mail.module");
|
|
12
|
+
const setting_module_1 = require("@hed-hog/admin/setting/setting.module");
|
|
11
13
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
12
14
|
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
13
15
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
@@ -23,7 +25,9 @@ exports.ContactUsModule = ContactUsModule = __decorate([
|
|
|
23
25
|
(0, common_1.forwardRef)(() => api_locale_1.LocaleModule),
|
|
24
26
|
(0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
|
|
25
27
|
(0, common_1.forwardRef)(() => api_pagination_1.PaginationModule),
|
|
26
|
-
(0, common_1.forwardRef)(() => admin_1.AdminModule)
|
|
28
|
+
(0, common_1.forwardRef)(() => admin_1.AdminModule),
|
|
29
|
+
(0, common_1.forwardRef)(() => setting_module_1.SettingModule),
|
|
30
|
+
(0, common_1.forwardRef)(() => mail_module_1.MailModule),
|
|
27
31
|
],
|
|
28
32
|
controllers: [contact_us_controller_1.ContactUsController],
|
|
29
33
|
providers: [contact_us_service_1.ContactUsService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-us.module.js","sourceRoot":"","sources":["../src/contact-us.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAA6C;AAC7C,oDAAmD;AACnD,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAoD;AACpD,mEAA8D;AAC9D,6DAAwD;
|
|
1
|
+
{"version":3,"file":"contact-us.module.js","sourceRoot":"","sources":["../src/contact-us.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAA6C;AAC7C,iEAA6D;AAC7D,0EAAsE;AACtE,oDAAmD;AACnD,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAoD;AACpD,mEAA8D;AAC9D,6DAAwD;AAcjD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAb3B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mBAAW,CAAC;YAC7B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC;YAC/B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;SAC7B;QACD,WAAW,EAAE,CAAC,2CAAmB,CAAC;QAClC,SAAS,EAAE,CAAC,qCAAgB,CAAC;QAC7B,OAAO,EAAE,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qCAAgB,CAAC,CAAC;KAC9C,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MailService
|
|
1
|
+
import { MailService, SettingService } from '@hed-hog/admin';
|
|
2
2
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
3
|
import { ContactUsResponseDTO } from './dto/contact-us-response.dto';
|
|
4
4
|
import { ContactUsSendDTO } from './dto/contact-us-send.dto';
|
|
@@ -7,27 +7,93 @@ export declare class ContactUsService {
|
|
|
7
7
|
private readonly prisma;
|
|
8
8
|
private readonly mail;
|
|
9
9
|
private readonly setting;
|
|
10
|
-
constructor(prisma: PrismaService, mail:
|
|
10
|
+
constructor(prisma: PrismaService, mail: MailService, setting: SettingService);
|
|
11
11
|
getContactUsSettings(): Promise<Record<string, any>>;
|
|
12
12
|
getUserStats(): Promise<{
|
|
13
|
-
total:
|
|
13
|
+
total: number;
|
|
14
14
|
totalNew: any;
|
|
15
15
|
totalResponded: any;
|
|
16
16
|
totalProgress: any;
|
|
17
|
+
totalArchived: any;
|
|
18
|
+
}>;
|
|
19
|
+
getContactUsMessage(id: number): Promise<{
|
|
20
|
+
user_contact_us_response_idTouser: {
|
|
21
|
+
name: string;
|
|
22
|
+
id: number;
|
|
23
|
+
created_at: Date;
|
|
24
|
+
updated_at: Date;
|
|
25
|
+
photo_id: number | null;
|
|
26
|
+
suspended_until: Date | null;
|
|
27
|
+
suspended_reason: string | null;
|
|
28
|
+
deactivated_at: Date | null;
|
|
29
|
+
};
|
|
30
|
+
user_contact_us_user_idTouser: {
|
|
31
|
+
name: string;
|
|
32
|
+
id: number;
|
|
33
|
+
created_at: Date;
|
|
34
|
+
updated_at: Date;
|
|
35
|
+
photo_id: number | null;
|
|
36
|
+
suspended_until: Date | null;
|
|
37
|
+
suspended_reason: string | null;
|
|
38
|
+
deactivated_at: Date | null;
|
|
39
|
+
};
|
|
40
|
+
} & {
|
|
41
|
+
name: string;
|
|
42
|
+
response: string | null;
|
|
43
|
+
id: number;
|
|
44
|
+
message: string;
|
|
45
|
+
created_at: Date;
|
|
46
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
47
|
+
email: string;
|
|
48
|
+
response_at: Date | null;
|
|
49
|
+
user_id: number | null;
|
|
50
|
+
response_id: number | null;
|
|
17
51
|
}>;
|
|
18
|
-
getContactUsMessage(id: number): Promise<any>;
|
|
19
52
|
getContactUsMessages(paginationParams: any, status: any): Promise<{
|
|
20
53
|
data: any[];
|
|
21
|
-
total:
|
|
54
|
+
total: number;
|
|
22
55
|
page: number;
|
|
23
56
|
pageSize: any;
|
|
24
57
|
prev: number;
|
|
25
58
|
next: number;
|
|
26
59
|
lastPage: number;
|
|
27
60
|
}>;
|
|
28
|
-
deleteContactUsMessage(id: number): Promise<
|
|
29
|
-
|
|
61
|
+
deleteContactUsMessage(id: number): Promise<{
|
|
62
|
+
name: string;
|
|
63
|
+
response: string | null;
|
|
64
|
+
id: number;
|
|
65
|
+
message: string;
|
|
66
|
+
created_at: Date;
|
|
67
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
68
|
+
email: string;
|
|
69
|
+
response_at: Date | null;
|
|
70
|
+
user_id: number | null;
|
|
71
|
+
response_id: number | null;
|
|
72
|
+
}>;
|
|
73
|
+
updateContactUsMessageStatus(id: number, { status }: ContactUsStatusDTO): Promise<{
|
|
74
|
+
name: string;
|
|
75
|
+
response: string | null;
|
|
76
|
+
id: number;
|
|
77
|
+
message: string;
|
|
78
|
+
created_at: Date;
|
|
79
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
80
|
+
email: string;
|
|
81
|
+
response_at: Date | null;
|
|
82
|
+
user_id: number | null;
|
|
83
|
+
response_id: number | null;
|
|
84
|
+
}>;
|
|
30
85
|
respondToContactUsMessage(locale: string, id: number, { response }: ContactUsResponseDTO, user: any): Promise<string>;
|
|
31
|
-
createContactUsMessage(locale: string, { name, email, message }: ContactUsSendDTO): Promise<
|
|
86
|
+
createContactUsMessage(locale: string, { name, email, message }: ContactUsSendDTO): Promise<{
|
|
87
|
+
name: string;
|
|
88
|
+
response: string | null;
|
|
89
|
+
id: number;
|
|
90
|
+
message: string;
|
|
91
|
+
created_at: Date;
|
|
92
|
+
status: import("@prisma/client").$Enums.contact_us_status_enum;
|
|
93
|
+
email: string;
|
|
94
|
+
response_at: Date | null;
|
|
95
|
+
user_id: number | null;
|
|
96
|
+
response_id: number | null;
|
|
97
|
+
}>;
|
|
32
98
|
}
|
|
33
99
|
//# sourceMappingURL=contact-us.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-us.service.d.ts","sourceRoot":"","sources":["../src/contact-us.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"contact-us.service.d.ts","sourceRoot":"","sources":["../src/contact-us.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,qBACa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAErB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAJP,MAAM,EAAE,aAAa,EAErB,IAAI,EAAE,WAAW,EAEjB,OAAO,EAAE,cAAc;IAGpC,oBAAoB;IAOpB,YAAY;;;;;;;IAmBZ,mBAAmB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU9B,oBAAoB,CAAC,gBAAgB,KAAA,EAAE,MAAM,KAAA;cAsHjC,GAAG,EAAE;;;;;;;;IAUjB,sBAAsB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;IAcjC,4BAA4B,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,kBAAkB;;;;;;;;;;;;IAmBvE,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,KAAA;IAgC9F,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,gBAAgB;;;;;;;;;;;;CA2CxF"}
|
|
@@ -8,6 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.ContactUsService = void 0;
|
|
13
16
|
const admin_1 = require("@hed-hog/admin");
|
|
@@ -27,15 +30,16 @@ let ContactUsService = class ContactUsService {
|
|
|
27
30
|
]);
|
|
28
31
|
}
|
|
29
32
|
async getUserStats() {
|
|
30
|
-
const statuses = ['new', 'answered', 'progress'];
|
|
33
|
+
const statuses = ['new', 'answered', 'progress', 'archived'];
|
|
31
34
|
const counts = await Promise.all(statuses.map((status) => this.prisma.contact_us.count({
|
|
32
|
-
where: { status
|
|
35
|
+
where: { status },
|
|
33
36
|
})));
|
|
34
37
|
return {
|
|
35
38
|
total: await this.prisma.contact_us.count({}),
|
|
36
39
|
totalNew: counts[0],
|
|
37
40
|
totalResponded: counts[1],
|
|
38
41
|
totalProgress: counts[2],
|
|
42
|
+
totalArchived: counts[3],
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
async getContactUsMessage(id) {
|
|
@@ -265,6 +269,9 @@ let ContactUsService = class ContactUsService {
|
|
|
265
269
|
exports.ContactUsService = ContactUsService;
|
|
266
270
|
exports.ContactUsService = ContactUsService = __decorate([
|
|
267
271
|
(0, common_1.Injectable)(),
|
|
272
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
273
|
+
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => admin_1.MailService))),
|
|
274
|
+
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => admin_1.SettingService))),
|
|
268
275
|
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
269
276
|
admin_1.MailService,
|
|
270
277
|
admin_1.SettingService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-us.service.js","sourceRoot":"","sources":["../src/contact-us.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contact-us.service.js","sourceRoot":"","sources":["../src/contact-us.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0CAA6D;AAC7D,oDAAoD;AACpD,2CAAmF;AACnF,uCAAkC;AAM3B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,MAAqB,EAErB,IAAiB,EAEjB,OAAuB;QAJvB,WAAM,GAAN,MAAM,CAAe;QAErB,SAAI,GAAJ,IAAI,CAA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AAG,EAAE,CAAC,mBAAW,CAAC,CAAC,CAAA;IAErC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAc,CAAC,CAAC,CAAA;qCAHhB,0BAAa;QAEf,mBAAW;QAER,sBAAc;GAP/B,gBAAgB,CA0R5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/contact-us",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"@nestjs/core": "^11",
|
|
10
10
|
"@nestjs/jwt": "^11",
|
|
11
11
|
"@nestjs/mapped-types": "*",
|
|
12
|
+
"@hed-hog/admin": "0.0.132",
|
|
13
|
+
"@hed-hog/api-pagination": "0.0.3",
|
|
12
14
|
"@hed-hog/api-locale": "0.0.10",
|
|
13
|
-
"@hed-hog/admin": "0.0.130",
|
|
14
|
-
"@hed-hog/api": "0.0.3",
|
|
15
15
|
"@hed-hog/api-prisma": "0.0.4",
|
|
16
|
-
"@hed-hog/api
|
|
16
|
+
"@hed-hog/api": "0.0.3"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
package/src/contact-us.module.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AdminModule } from '@hed-hog/admin';
|
|
2
|
+
import { MailModule } from '@hed-hog/admin/mail/mail.module';
|
|
3
|
+
import { SettingModule } from '@hed-hog/admin/setting/setting.module';
|
|
2
4
|
import { LocaleModule } from '@hed-hog/api-locale';
|
|
3
5
|
import { PaginationModule } from '@hed-hog/api-pagination';
|
|
4
6
|
import { PrismaModule } from '@hed-hog/api-prisma';
|
|
@@ -10,7 +12,9 @@ import { ContactUsService } from './contact-us.service';
|
|
|
10
12
|
forwardRef(() => LocaleModule),
|
|
11
13
|
forwardRef(() => PrismaModule),
|
|
12
14
|
forwardRef(() => PaginationModule),
|
|
13
|
-
forwardRef(() => AdminModule)
|
|
15
|
+
forwardRef(() => AdminModule),
|
|
16
|
+
forwardRef(() => SettingModule),
|
|
17
|
+
forwardRef(() => MailModule),
|
|
14
18
|
],
|
|
15
19
|
controllers: [ContactUsController],
|
|
16
20
|
providers: [ContactUsService],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MailService
|
|
1
|
+
import { MailService, SettingService } from '@hed-hog/admin';
|
|
2
2
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
|
-
import { Injectable, NotFoundException } from '@nestjs/common';
|
|
3
|
+
import { forwardRef, Inject, Injectable, NotFoundException } from '@nestjs/common';
|
|
4
4
|
import { format } from 'date-fns';
|
|
5
5
|
import { ContactUsResponseDTO } from './dto/contact-us-response.dto';
|
|
6
6
|
import { ContactUsSendDTO } from './dto/contact-us-send.dto';
|
|
@@ -9,8 +9,11 @@ import { ContactUsStatusDTO } from './dto/contact-us-status.dto';
|
|
|
9
9
|
@Injectable()
|
|
10
10
|
export class ContactUsService {
|
|
11
11
|
constructor(
|
|
12
|
+
@Inject(forwardRef(() => PrismaService))
|
|
12
13
|
private readonly prisma: PrismaService,
|
|
13
|
-
|
|
14
|
+
@Inject(forwardRef(() => MailService))
|
|
15
|
+
private readonly mail: MailService,
|
|
16
|
+
@Inject(forwardRef(() => SettingService))
|
|
14
17
|
private readonly setting: SettingService,
|
|
15
18
|
) {}
|
|
16
19
|
|
|
@@ -22,11 +25,11 @@ export class ContactUsService {
|
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
async getUserStats() {
|
|
25
|
-
const statuses = ['new', 'answered', 'progress'];
|
|
28
|
+
const statuses: any = ['new', 'answered', 'progress', 'archived'];
|
|
26
29
|
const counts = await Promise.all(
|
|
27
30
|
statuses.map((status) =>
|
|
28
31
|
this.prisma.contact_us.count({
|
|
29
|
-
where: { status
|
|
32
|
+
where: { status },
|
|
30
33
|
}),
|
|
31
34
|
),
|
|
32
35
|
);
|
|
@@ -36,6 +39,7 @@ export class ContactUsService {
|
|
|
36
39
|
totalNew: counts[0],
|
|
37
40
|
totalResponded: counts[1],
|
|
38
41
|
totalProgress: counts[2],
|
|
42
|
+
totalArchived: counts[3],
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
45
|
|