@aurispec/core-backend 1.0.3 → 1.0.5
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/common/configs/cloudinary.d.ts +1 -1
- package/dist/common/configs/cloudinary.d.ts.map +1 -1
- package/dist/common/configs/cloudinary.js +2 -1
- package/dist/common/utils/index.d.ts +5 -0
- package/dist/common/utils/index.d.ts.map +1 -1
- package/dist/common/utils/index.js +16 -0
- package/dist/database/migrations/1772984882048-modified_reviews_table.d.ts +7 -0
- package/dist/database/migrations/1772984882048-modified_reviews_table.d.ts.map +1 -0
- package/dist/database/migrations/1772984882048-modified_reviews_table.js +61 -0
- package/dist/models/BusinessModel.d.ts +2 -0
- package/dist/models/BusinessModel.d.ts.map +1 -1
- package/dist/models/BusinessModel.js +9 -0
- package/dist/models/ReviewModel.d.ts +5 -0
- package/dist/models/ReviewModel.d.ts.map +1 -1
- package/dist/models/ReviewModel.js +19 -0
- package/dist/models/UserModel.d.ts +2 -0
- package/dist/models/UserModel.d.ts.map +1 -1
- package/dist/models/UserModel.js +9 -0
- package/package.json +1 -1
- package/dist/app.js +0 -59
- package/dist/common/configs/express.js +0 -29
- package/dist/common/configs/websocket.js +0 -17
- package/dist/common/constants/chat.d.ts +0 -18
- package/dist/common/constants/chat.d.ts.map +0 -1
- package/dist/common/constants/chat.js +0 -20
- package/dist/common/constants/messages/admin.messages.d.ts +0 -33
- package/dist/common/constants/messages/admin.messages.d.ts.map +0 -1
- package/dist/common/constants/messages/admin.messages.js +0 -35
- package/dist/common/constants/messages/user.messages.d.ts +0 -33
- package/dist/common/constants/messages/user.messages.d.ts.map +0 -1
- package/dist/common/constants/messages/user.messages.js +0 -35
- package/dist/common/dtos/AdminDto.d.ts +0 -5
- package/dist/common/dtos/AdminDto.d.ts.map +0 -1
- package/dist/common/dtos/AdminDto.js +0 -30
- package/dist/common/dtos/ArticleDto.d.ts +0 -11
- package/dist/common/dtos/ArticleDto.d.ts.map +0 -1
- package/dist/common/dtos/ArticleDto.js +0 -61
- package/dist/common/dtos/BusinessDto.d.ts +0 -12
- package/dist/common/dtos/BusinessDto.d.ts.map +0 -1
- package/dist/common/dtos/BusinessDto.js +0 -59
- package/dist/common/dtos/ChatDto.d.ts +0 -17
- package/dist/common/dtos/ChatDto.d.ts.map +0 -1
- package/dist/common/dtos/ChatDto.js +0 -89
- package/dist/common/dtos/CommonDto.d.ts +0 -13
- package/dist/common/dtos/CommonDto.d.ts.map +0 -1
- package/dist/common/dtos/CommonDto.js +0 -59
- package/dist/common/dtos/CommunityDto.d.ts +0 -10
- package/dist/common/dtos/CommunityDto.d.ts.map +0 -1
- package/dist/common/dtos/CommunityDto.js +0 -72
- package/dist/common/dtos/EventDto.d.ts +0 -24
- package/dist/common/dtos/EventDto.d.ts.map +0 -1
- package/dist/common/dtos/EventDto.js +0 -72
- package/dist/common/dtos/IPaginator.d.ts +0 -15
- package/dist/common/dtos/IPaginator.d.ts.map +0 -1
- package/dist/common/dtos/IPaginator.js +0 -40
- package/dist/common/dtos/Plan.dto.d.ts +0 -10
- package/dist/common/dtos/Plan.dto.d.ts.map +0 -1
- package/dist/common/dtos/Plan.dto.js +0 -66
- package/dist/common/dtos/PostDto.d.ts +0 -13
- package/dist/common/dtos/PostDto.d.ts.map +0 -1
- package/dist/common/dtos/PostDto.js +0 -75
- package/dist/common/dtos/ProductDto.d.ts +0 -13
- package/dist/common/dtos/ProductDto.d.ts.map +0 -1
- package/dist/common/dtos/ProductDto.js +0 -66
- package/dist/common/dtos/ServiceDto.d.ts +0 -19
- package/dist/common/dtos/ServiceDto.d.ts.map +0 -1
- package/dist/common/dtos/ServiceDto.js +0 -93
- package/dist/common/dtos/UserDto.d.ts +0 -70
- package/dist/common/dtos/UserDto.d.ts.map +0 -1
- package/dist/common/dtos/UserDto.js +0 -313
- package/dist/common/types/IPagination.d.ts +0 -15
- package/dist/common/types/IPagination.d.ts.map +0 -1
- package/dist/common/types/IPagination.js +0 -2
- package/dist/common/utils/axios.js +0 -26
- package/dist/common/utils/socket.js +0 -16
- package/dist/database/seeds/CommunityDataSeeder.js +0 -48
- package/dist/database/seeds/EventDataSeeder.js +0 -54
- package/dist/database/seeds/FeatureSeeder.js +0 -131
- package/dist/database/seeds/MarketplaceDataSeeder.js +0 -95
- package/dist/database/seeds/PlanSeeder.js +0 -78
- package/dist/database/seeds/UserProfileDataSeeder.js +0 -215
- package/dist/database/seeds/index.js +0 -39
- package/dist/services/StripeService.js +0 -288
- package/dist/services/mobile/ArticleCommentService.js +0 -479
- package/dist/services/mobile/ArticleService.js +0 -507
- package/dist/services/mobile/AuthService.js +0 -362
- package/dist/services/mobile/BusinessService.js +0 -267
- package/dist/services/mobile/BusinessServiceService.js +0 -383
- package/dist/services/mobile/CardService.js +0 -249
- package/dist/services/mobile/ChatService.js +0 -324
- package/dist/services/mobile/CommunityMemberService.js +0 -193
- package/dist/services/mobile/CommunityService.js +0 -561
- package/dist/services/mobile/CompleteProfileService.js +0 -308
- package/dist/services/mobile/ConnectionService.js +0 -338
- package/dist/services/mobile/EventAttendanceService.js +0 -343
- package/dist/services/mobile/EventService.js +0 -540
- package/dist/services/mobile/NotificationService.js +0 -89
- package/dist/services/mobile/PasswordResetService.js +0 -168
- package/dist/services/mobile/PlanService.js +0 -85
- package/dist/services/mobile/PostCommentService.js +0 -611
- package/dist/services/mobile/PostService.js +0 -640
- package/dist/services/mobile/ProductService.js +0 -360
- package/dist/services/mobile/RedisService.js +0 -16
- package/dist/services/mobile/TransactionService.js +0 -51
- package/dist/services/mobile/UploadService.js +0 -110
- package/dist/services/mobile/UserService.js +0 -128
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketplaceDataSeeder = MarketplaceDataSeeder;
|
|
4
|
-
exports.BusinessIdCategoryDataSeeder = BusinessIdCategoryDataSeeder;
|
|
5
|
-
exports.BusinessCategoryDataSeeder = BusinessCategoryDataSeeder;
|
|
6
|
-
const BusinessIdCategoryRepository_1 = require("../../repositories/BusinessIdCategoryRepository");
|
|
7
|
-
const BusinessCategoryRepository_1 = require("../../repositories/BusinessCategoryRepository");
|
|
8
|
-
const CategoryRepository_1 = require("../../repositories/CategoryRepository");
|
|
9
|
-
async function MarketplaceDataSeeder() {
|
|
10
|
-
const categoryRepository = new CategoryRepository_1.CategoryRepository();
|
|
11
|
-
const categories = [
|
|
12
|
-
{
|
|
13
|
-
name: "Medicine"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "Food"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "MsardTheis chect Supplement"
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
for (const category of categories) {
|
|
23
|
-
const { name } = category;
|
|
24
|
-
const exists = await categoryRepository.basicFindOneByConditions({
|
|
25
|
-
name
|
|
26
|
-
});
|
|
27
|
-
if (!exists) {
|
|
28
|
-
await categoryRepository.create({
|
|
29
|
-
name,
|
|
30
|
-
});
|
|
31
|
-
console.log(`✅ Product category "${category.name}" seeded`);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
console.log(`⚡ Product category "${category.name}" already exists, skipping`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function BusinessIdCategoryDataSeeder() {
|
|
39
|
-
const businessIdCategoryRepository = new BusinessIdCategoryRepository_1.BusinessIdCategoryRepository();
|
|
40
|
-
const categories = [
|
|
41
|
-
{
|
|
42
|
-
name: "Driver's license"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: "National ID"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "Int'l Passport"
|
|
49
|
-
}
|
|
50
|
-
];
|
|
51
|
-
for (const businessCategory of categories) {
|
|
52
|
-
const { name } = businessCategory;
|
|
53
|
-
const exists = await businessIdCategoryRepository.basicFindOneByConditions({
|
|
54
|
-
name
|
|
55
|
-
});
|
|
56
|
-
if (!exists) {
|
|
57
|
-
await businessIdCategoryRepository.create({
|
|
58
|
-
name,
|
|
59
|
-
});
|
|
60
|
-
console.log(`✅ Business ID category "${name}" seeded`);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
console.log(`⚡ Business ID category "${name}" already exists, skipping`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async function BusinessCategoryDataSeeder() {
|
|
68
|
-
const businessCategoryRepository = new BusinessCategoryRepository_1.BusinessCategoryRepository();
|
|
69
|
-
const categories = [
|
|
70
|
-
{
|
|
71
|
-
name: "Fintech"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: "Food stuff"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "Education"
|
|
78
|
-
}
|
|
79
|
-
];
|
|
80
|
-
for (const businessCategory of categories) {
|
|
81
|
-
const { name } = businessCategory;
|
|
82
|
-
const exists = await businessCategoryRepository.basicFindOneByConditions({
|
|
83
|
-
name
|
|
84
|
-
});
|
|
85
|
-
if (!exists) {
|
|
86
|
-
await businessCategoryRepository.create({
|
|
87
|
-
name,
|
|
88
|
-
});
|
|
89
|
-
console.log(`✅ Business category "${businessCategory.name}" seeded`);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
console.log(`⚡ Business category "${businessCategory.name}" already exists, skipping`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PlanSeeder = PlanSeeder;
|
|
7
|
-
const StripeService_1 = __importDefault(require("../../services/StripeService"));
|
|
8
|
-
const PlanRepository_1 = require("../../repositories/PlanRepository");
|
|
9
|
-
async function PlanSeeder() {
|
|
10
|
-
const planRepository = new PlanRepository_1.PlanRepository();
|
|
11
|
-
const stripeService = new StripeService_1.default();
|
|
12
|
-
const plans = [
|
|
13
|
-
{
|
|
14
|
-
name: "Free",
|
|
15
|
-
description: "Get started with basic features",
|
|
16
|
-
monthly: 0,
|
|
17
|
-
yearly: 0,
|
|
18
|
-
stripe_monthly_plan_code: null,
|
|
19
|
-
stripe_yearly_plan_code: null,
|
|
20
|
-
icon: "Sparkles",
|
|
21
|
-
discount: 0,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "Care Circle Plan",
|
|
25
|
-
description: "Basic things you need",
|
|
26
|
-
yearly: 17.99,
|
|
27
|
-
stripe_monthly_plan_code: null,
|
|
28
|
-
stripe_yearly_plan_code: null,
|
|
29
|
-
icon: "Crown",
|
|
30
|
-
monthly: 7.99,
|
|
31
|
-
discount: 0,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: "Impact pro plan",
|
|
35
|
-
description: "For serious users",
|
|
36
|
-
monthly: 10.88,
|
|
37
|
-
yearly: 200.88,
|
|
38
|
-
discount: 0,
|
|
39
|
-
stripe_monthly_plan_code: null,
|
|
40
|
-
stripe_yearly_plan_code: null,
|
|
41
|
-
icon: "Zap",
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
for (const plan of plans) {
|
|
45
|
-
const { name, description, monthly, yearly, discount } = plan;
|
|
46
|
-
const exists = await planRepository.basicFindOneByConditions({
|
|
47
|
-
name
|
|
48
|
-
});
|
|
49
|
-
if (!exists) {
|
|
50
|
-
if (monthly > 0 && yearly > 0) {
|
|
51
|
-
const stripeMonthlyPlan = await stripeService.createStripePlan(name, monthly, "month");
|
|
52
|
-
const stripeYearlyPlan = await stripeService.createStripePlan(name, yearly, "year");
|
|
53
|
-
await planRepository.create({
|
|
54
|
-
name,
|
|
55
|
-
description,
|
|
56
|
-
monthly: monthly.toString(),
|
|
57
|
-
yearly: yearly.toString(),
|
|
58
|
-
stripe_monthly_plan_code: stripeMonthlyPlan?.data?.plan_code,
|
|
59
|
-
stripe_yearly_plan_code: stripeYearlyPlan?.data?.plan_code,
|
|
60
|
-
discount: discount.toString(),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
await planRepository.create({
|
|
65
|
-
name,
|
|
66
|
-
description,
|
|
67
|
-
monthly: monthly.toString(),
|
|
68
|
-
yearly: yearly.toString(),
|
|
69
|
-
discount: discount.toString()
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
console.log(`✅ Plan "${plan.name}" seeded`);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
console.log(`⚡ Plan "${plan.name}" already exists, skipping`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserProfileDataSeeder = UserProfileDataSeeder;
|
|
4
|
-
const SpeechRepository_1 = require("../../repositories/SpeechRepository");
|
|
5
|
-
const DiagnosisLevelRepository_1 = require("../../repositories/DiagnosisLevelRepository");
|
|
6
|
-
const InterestRepository_1 = require("../../repositories/InterestRepository");
|
|
7
|
-
const ChallengeRepository_1 = require("../../repositories/ChallengeRepository");
|
|
8
|
-
const EducationRepository_1 = require("../../repositories/EducationRepository");
|
|
9
|
-
const GoalRepository_1 = require("../../repositories/GoalRepository");
|
|
10
|
-
async function UserProfileDataSeeder() {
|
|
11
|
-
const diagnosisLevelRepository = new DiagnosisLevelRepository_1.DiagnosisLevelRepository();
|
|
12
|
-
const interestRepository = new InterestRepository_1.InterestRepository();
|
|
13
|
-
const speechRepository = new SpeechRepository_1.SpeechRepository();
|
|
14
|
-
const challengeRepository = new ChallengeRepository_1.ChallengeRepository();
|
|
15
|
-
const educationRepository = new EducationRepository_1.EducationRepository();
|
|
16
|
-
const goalRepository = new GoalRepository_1.GoalRepository();
|
|
17
|
-
const diagnosis_levels = [
|
|
18
|
-
{
|
|
19
|
-
name: "Level 1 - Low support needs"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "Level 2 - Moderate support needs"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "Level 3 - High support needs"
|
|
26
|
-
},
|
|
27
|
-
];
|
|
28
|
-
const interests = [
|
|
29
|
-
{
|
|
30
|
-
name: "Peer support"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "Playdates"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "Coffee chats"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "Volunteering"
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
const speeches = [
|
|
43
|
-
{
|
|
44
|
-
name: "Non-speaking"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "Semi-verbal"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: "Verbal"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "Conversational"
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
|
-
const challenges = [
|
|
57
|
-
{
|
|
58
|
-
name: "Aggression"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "Hyperactivity"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "Sensory"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: "Picky Eater"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "Insomnia"
|
|
71
|
-
}, {
|
|
72
|
-
name: "Eloping"
|
|
73
|
-
}, {
|
|
74
|
-
name: "Executive Function"
|
|
75
|
-
}, {
|
|
76
|
-
name: "Not Toilet-trained"
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
const education_levels = [
|
|
80
|
-
{
|
|
81
|
-
name: "ABA program"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "General education"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: "High school"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "Graduate"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "College"
|
|
94
|
-
}, {
|
|
95
|
-
name: "Eloping"
|
|
96
|
-
}, {
|
|
97
|
-
name: "Work study program"
|
|
98
|
-
}, {
|
|
99
|
-
name: "Not school-ready"
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
const goals = [
|
|
103
|
-
{
|
|
104
|
-
name: "Join community"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: "Help my child"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "Visit marketplace"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "Learn more about Autism"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: "Access to resources"
|
|
117
|
-
}, {
|
|
118
|
-
name: "Connect with fellow cargivers"
|
|
119
|
-
}, {
|
|
120
|
-
name: "Access therapy sessions"
|
|
121
|
-
}, {
|
|
122
|
-
name: "Connect with professionals"
|
|
123
|
-
},
|
|
124
|
-
];
|
|
125
|
-
for (const diagnosis_level of diagnosis_levels) {
|
|
126
|
-
const { name } = diagnosis_level;
|
|
127
|
-
const exists = await diagnosisLevelRepository.basicFindOneByConditions({
|
|
128
|
-
name
|
|
129
|
-
});
|
|
130
|
-
if (!exists) {
|
|
131
|
-
await diagnosisLevelRepository.create({
|
|
132
|
-
name,
|
|
133
|
-
});
|
|
134
|
-
console.log(`✅ Diagnosis level "${diagnosis_level.name}" seeded`);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
console.log(`⚡ Diagnosis level "${diagnosis_level.name}" already exists, skipping`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
for (const interest of interests) {
|
|
141
|
-
const { name } = interest;
|
|
142
|
-
const exists = await interestRepository.basicFindOneByConditions({
|
|
143
|
-
name
|
|
144
|
-
});
|
|
145
|
-
if (!exists) {
|
|
146
|
-
await interestRepository.create({
|
|
147
|
-
name,
|
|
148
|
-
});
|
|
149
|
-
console.log(`✅ Diagnosis level "${interest.name}" seeded`);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
console.log(`⚡ Diagnosis level "${interest.name}" already exists, skipping`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
for (const speech of speeches) {
|
|
156
|
-
const { name } = speech;
|
|
157
|
-
const exists = await speechRepository.basicFindOneByConditions({
|
|
158
|
-
name
|
|
159
|
-
});
|
|
160
|
-
if (!exists) {
|
|
161
|
-
await speechRepository.create({
|
|
162
|
-
name,
|
|
163
|
-
});
|
|
164
|
-
console.log(`✅ Speech "${speech.name}" seeded`);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
console.log(`⚡ Speech "${speech.name}" already exists, skipping`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
for (const challenge of challenges) {
|
|
171
|
-
const { name } = challenge;
|
|
172
|
-
const exists = await challengeRepository.basicFindOneByConditions({
|
|
173
|
-
name
|
|
174
|
-
});
|
|
175
|
-
if (!exists) {
|
|
176
|
-
await challengeRepository.create({
|
|
177
|
-
name,
|
|
178
|
-
});
|
|
179
|
-
console.log(`✅ Challenge "${challenge.name}" seeded`);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
console.log(`⚡ Challenge "${challenge.name}" already exists, skipping`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
for (const education of education_levels) {
|
|
186
|
-
const { name } = education;
|
|
187
|
-
const exists = await educationRepository.basicFindOneByConditions({
|
|
188
|
-
name
|
|
189
|
-
});
|
|
190
|
-
if (!exists) {
|
|
191
|
-
await educationRepository.create({
|
|
192
|
-
name,
|
|
193
|
-
});
|
|
194
|
-
console.log(`✅ Education "${education.name}" seeded`);
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
console.log(`⚡ Education "${education.name}" already exists, skipping`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
for (const goal of goals) {
|
|
201
|
-
const { name } = goal;
|
|
202
|
-
const exists = await goalRepository.basicFindOneByConditions({
|
|
203
|
-
name
|
|
204
|
-
});
|
|
205
|
-
if (!exists) {
|
|
206
|
-
await goalRepository.create({
|
|
207
|
-
name,
|
|
208
|
-
});
|
|
209
|
-
console.log(`✅ Goal "${goal.name}" seeded`);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
console.log(`⚡ Goal "${goal.name}" already exists, skipping`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const postgres_1 = require("../../common/configs/postgres");
|
|
4
|
-
const MarketplaceDataSeeder_1 = require("./MarketplaceDataSeeder");
|
|
5
|
-
async function runSeeders() {
|
|
6
|
-
try {
|
|
7
|
-
// Initialize the data source before running seeders
|
|
8
|
-
if (!postgres_1.dataSource.isInitialized) {
|
|
9
|
-
console.log("🔌 Initializing database connection...");
|
|
10
|
-
await postgres_1.dataSource.initialize();
|
|
11
|
-
console.log("✅ Database connected successfully");
|
|
12
|
-
}
|
|
13
|
-
// Run seeders
|
|
14
|
-
// await UserProfileDataSeeder();
|
|
15
|
-
// await EventDataSeeder();
|
|
16
|
-
// await PlanSeeder();
|
|
17
|
-
// await FeatureSeeder();
|
|
18
|
-
// await CommunityDataSeeder()
|
|
19
|
-
// await MarketplaceDataSeeder()
|
|
20
|
-
await (0, MarketplaceDataSeeder_1.BusinessCategoryDataSeeder)();
|
|
21
|
-
await (0, MarketplaceDataSeeder_1.BusinessIdCategoryDataSeeder)();
|
|
22
|
-
console.log("🌱 Seeding complete!");
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
console.error("❌ Seeding error:", error);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
// Close the connection after seeding
|
|
30
|
-
if (postgres_1.dataSource.isInitialized) {
|
|
31
|
-
await postgres_1.dataSource.destroy();
|
|
32
|
-
console.log("🔒 Database connection closed");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
runSeeders().catch((err) => {
|
|
37
|
-
console.error("❌ Seeding error:", err);
|
|
38
|
-
process.exit(1);
|
|
39
|
-
});
|