Skip to content

Commit 05f4cd7

Browse files
authored
feat: refactor mailchimp email and serviceUserProfiles (#428)
1 parent 19a0709 commit 05f4cd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2745
-2507
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ ZAPIER_TOKEN=
129129
SLACK_WEBHOOK_URL=
130130
CRISP_TOKEN=
131131
CRISP_WEBSITE_TOKEN=
132-
MAILCHIMP_MANDRILL_API_KEY=
133-
MAILCHIMP_THERAPY_TEMPLATE_ID=
134-
MAILCHIMP_THERAPY_FROM_EMAIL=
132+
MAILCHIMP_API_KEY=
133+
MAILCHIMP_AUDIENCE_ID=
134+
MAILCHIMP_SERVER_PREFIX=
135135
RESPOND_IO_CREATE_CONTACT_WEBHOOK=
136136
RESPOND_IO_DELETE_CONTACT_WEBHOOK=
137137
```

docker-compose.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: '3.9'
22

33
services:
4-
54
api:
65
container_name: bloom-backend
76
build:
@@ -16,7 +15,7 @@ services:
1615
volumes:
1716
- .:/app
1817

19-
db:
18+
db:
2019
image: postgres:14-alpine
2120
container_name: bloom-local-db
2221
restart: unless-stopped
@@ -25,4 +24,4 @@ services:
2524
environment:
2625
POSTGRES_USER: postgres
2726
POSTGRES_PASSWORD: postgres
28-
POSTGRES_DB: bloom
27+
POSTGRES_DB: bloom

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"migration:show": "yarn build && yarn typeorm -- migration:show"
3030
},
3131
"dependencies": {
32-
"@mailchimp/mailchimp_transactional": "^1.0.47",
32+
"@mailchimp/mailchimp_marketing": "^3.0.80",
3333
"@nestjs/common": "^10.3.6",
3434
"@nestjs/config": "^3.2.2",
3535
"@nestjs/core": "^10.3.6",

src/api/crisp/crisp-api.interfaces.ts

+44-29
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,56 @@
1-
export interface CrispResponse {
2-
error: boolean;
3-
reason: string;
4-
data: {
5-
data: unknown;
6-
};
1+
export interface CrispProfileCustomFields {
2+
signed_up_at?: string;
3+
language?: string;
4+
marketing_permission?: boolean;
5+
service_emails_permission?: boolean;
6+
partners?: string;
7+
feature_live_chat?: boolean;
8+
feature_therapy?: boolean;
9+
therapy_sessions_remaining?: number;
10+
therapy_sessions_redeemed?: number;
11+
course_hst?: string;
12+
course_hst_sessions?: string;
13+
course_pst?: string;
14+
course_pst_sessions?: string;
15+
course_dbr?: string;
16+
course_dbr_sessions?: string;
17+
course_iaro?: string;
18+
course_iaro_sessions?: string;
19+
course_rtar?: string;
20+
course_rtar_sessions?: string;
21+
course_rryts?: string;
22+
course_rryts_sessions?: string;
23+
course_ma?: string;
24+
course_ma_sessions?: string;
25+
course_cb?: string;
26+
course_cb_sessions?: string;
727
}
8-
export interface CrispProfileResponse {
9-
error: boolean;
10-
reason: string;
11-
data: {
12-
segments: string[];
13-
};
14-
}
15-
export interface NewPeopleProfile {
16-
email: string;
17-
person: {
18-
nickname: string;
19-
};
20-
segments: string[];
21-
}
22-
23-
export interface UpdatePeopleProfile {
28+
export interface CrispProfileBase {
2429
email?: string;
2530
person?: {
2631
nickname: string;
32+
locales: string[];
2733
};
2834
segments?: string[];
35+
notepad?: string;
36+
active?: number;
37+
// company?: {}
2938
}
3039

31-
export interface NewPeopleProfileResponse extends CrispResponse {
32-
data: {
33-
data: {
34-
people_id: string;
35-
};
40+
export interface CrispProfileBaseResponse {
41+
error: boolean;
42+
reason: string;
43+
data: CrispProfileBase & {
44+
people_id: string;
3645
};
3746
}
3847

39-
export interface PeopleData {
40-
[key: string]: string | number | boolean;
48+
export interface NewCrispProfileBaseResponse {
49+
data: CrispProfileBaseResponse;
50+
}
51+
52+
export interface CrispProfileDataResponse {
53+
error: boolean;
54+
reason: string;
55+
data: { data: CrispProfileCustomFields };
4156
}

src/api/crisp/crisp-api.spec.ts

-83
This file was deleted.

0 commit comments

Comments
 (0)