@experts_hub/shared 1.0.674 → 1.0.676

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/index.js CHANGED
@@ -86,6 +86,7 @@ __export(index_exports, {
86
86
  BankAccountTypeEnum: () => BankAccountTypeEnum,
87
87
  BankDetail: () => BankDetail,
88
88
  BaseEntity: () => BaseEntity,
89
+ BillingCycle: () => BillingCycle,
89
90
  BillingCycleEnum: () => BillingCycleEnum,
90
91
  CALENDLY_PATTERN: () => CALENDLY_PATTERN,
91
92
  CITY_PATTERN: () => CITY_PATTERN,
@@ -202,7 +203,6 @@ __export(index_exports, {
202
203
  FREELANCER_EXPERIENCE_PATTERN: () => FREELANCER_EXPERIENCE_PATTERN,
203
204
  FREELANCER_PROJECT_PATTERN: () => FREELANCER_PROJECT_PATTERN,
204
205
  FREELANCER_SKILL_PATTERN: () => FREELANCER_SKILL_PATTERN,
205
- Feature: () => Feature,
206
206
  FetchClientInfoForChatDto: () => FetchClientInfoForChatDto,
207
207
  FetchFreelancerInfoForChatDto: () => FetchFreelancerInfoForChatDto,
208
208
  ForgotPasswordDto: () => ForgotPasswordDto,
@@ -322,6 +322,8 @@ __export(index_exports, {
322
322
  PROFILE_PATTERN: () => PROFILE_PATTERN,
323
323
  Permission: () => Permission,
324
324
  Plan: () => Plan,
325
+ PlanFeature: () => PlanFeature,
326
+ PlanPricing: () => PlanPricing,
325
327
  PreCheckoutCalculationDto: () => PreCheckoutCalculationDto,
326
328
  ProjectDto: () => ProjectDto,
327
329
  Provider: () => Provider,
@@ -2995,6 +2997,9 @@ __decorateClass([
2995
2997
  __decorateClass([
2996
2998
  (0, import_typeorm19.Column)({ name: "is_contract_sent", type: "boolean", default: false })
2997
2999
  ], F2FInterview.prototype, "isContractSent", 2);
3000
+ __decorateClass([
3001
+ (0, import_typeorm19.Column)({ name: "feedback", type: "varchar", nullable: true })
3002
+ ], F2FInterview.prototype, "feedback", 2);
2998
3003
  __decorateClass([
2999
3004
  (0, import_typeorm19.OneToMany)(() => F2FInterviewSchedule, (f2fInterviewSchedule) => f2fInterviewSchedule.f2fInterview)
3000
3005
  ], F2FInterview.prototype, "schedules", 2);
@@ -13013,71 +13018,28 @@ JobRoles = __decorateClass([
13013
13018
  (0, import_typeorm72.Entity)("job_roles")
13014
13019
  ], JobRoles);
13015
13020
 
13016
- // src/entities/plan.entity.ts
13017
- var import_typeorm74 = require("typeorm");
13018
-
13019
- // src/entities/feature.entity.ts
13020
- var import_typeorm73 = require("typeorm");
13021
- var Feature = class extends BaseEntity {
13022
- };
13023
- __decorateClass([
13024
- (0, import_typeorm73.Column)({ name: "name", type: "varchar", unique: true })
13025
- ], Feature.prototype, "name", 2);
13026
- __decorateClass([
13027
- (0, import_typeorm73.ManyToMany)(() => Plan, (plan) => plan.features)
13028
- ], Feature.prototype, "plans", 2);
13029
- Feature = __decorateClass([
13030
- (0, import_typeorm73.Entity)("features")
13031
- ], Feature);
13032
-
13033
- // src/entities/plan.entity.ts
13034
- var Plan = class extends BaseEntity {
13035
- };
13036
- __decorateClass([
13037
- (0, import_typeorm74.Column)({ name: "name", type: "varchar", unique: true })
13038
- ], Plan.prototype, "name", 2);
13039
- __decorateClass([
13040
- (0, import_typeorm74.Column)({ name: "description", type: "varchar", nullable: true })
13041
- ], Plan.prototype, "description", 2);
13042
- __decorateClass([
13043
- (0, import_typeorm74.Column)({ name: "price", type: "decimal", precision: 10, scale: 2 })
13044
- ], Plan.prototype, "price", 2);
13045
- __decorateClass([
13046
- (0, import_typeorm74.Column)({ name: "billing_period", type: "varchar" })
13047
- ], Plan.prototype, "billingPeriod", 2);
13048
- __decorateClass([
13049
- (0, import_typeorm74.Column)({ name: "is_current", type: "boolean", default: false })
13050
- ], Plan.prototype, "isCurrent", 2);
13051
- __decorateClass([
13052
- (0, import_typeorm74.ManyToMany)(() => Feature, (feature) => feature.plans, { cascade: true }),
13053
- (0, import_typeorm74.JoinTable)()
13054
- ], Plan.prototype, "features", 2);
13055
- Plan = __decorateClass([
13056
- (0, import_typeorm74.Entity)("plans")
13057
- ], Plan);
13058
-
13059
13021
  // src/entities/cms.entity.ts
13060
- var import_typeorm75 = require("typeorm");
13022
+ var import_typeorm73 = require("typeorm");
13061
13023
  var Cms = class extends BaseEntity {
13062
13024
  };
13063
13025
  __decorateClass([
13064
- (0, import_typeorm75.Column)({ name: "title", type: "varchar", nullable: true })
13026
+ (0, import_typeorm73.Column)({ name: "title", type: "varchar", nullable: true })
13065
13027
  ], Cms.prototype, "title", 2);
13066
13028
  __decorateClass([
13067
- (0, import_typeorm75.Column)({ name: "slug", type: "varchar", nullable: true, unique: true })
13029
+ (0, import_typeorm73.Column)({ name: "slug", type: "varchar", nullable: true, unique: true })
13068
13030
  ], Cms.prototype, "slug", 2);
13069
13031
  __decorateClass([
13070
- (0, import_typeorm75.Column)({ name: "content", type: "varchar", nullable: true })
13032
+ (0, import_typeorm73.Column)({ name: "content", type: "varchar", nullable: true })
13071
13033
  ], Cms.prototype, "content", 2);
13072
13034
  __decorateClass([
13073
- (0, import_typeorm75.Column)({ name: "is_active", type: "boolean", default: true })
13035
+ (0, import_typeorm73.Column)({ name: "is_active", type: "boolean", default: true })
13074
13036
  ], Cms.prototype, "isActive", 2);
13075
13037
  Cms = __decorateClass([
13076
- (0, import_typeorm75.Entity)("cms")
13038
+ (0, import_typeorm73.Entity)("cms")
13077
13039
  ], Cms);
13078
13040
 
13079
13041
  // src/entities/lead.entity.ts
13080
- var import_typeorm76 = require("typeorm");
13042
+ var import_typeorm74 = require("typeorm");
13081
13043
  var CategoryEmum = /* @__PURE__ */ ((CategoryEmum2) => {
13082
13044
  CategoryEmum2["BUSINESS"] = "BUSINESS";
13083
13045
  CategoryEmum2["FREELANCER"] = "FREELANCER";
@@ -13086,22 +13048,22 @@ var CategoryEmum = /* @__PURE__ */ ((CategoryEmum2) => {
13086
13048
  var Lead = class extends BaseEntity {
13087
13049
  };
13088
13050
  __decorateClass([
13089
- (0, import_typeorm76.Column)({ name: "name", type: "varchar", nullable: true })
13051
+ (0, import_typeorm74.Column)({ name: "name", type: "varchar", nullable: true })
13090
13052
  ], Lead.prototype, "name", 2);
13091
13053
  __decorateClass([
13092
- (0, import_typeorm76.Column)({ name: "mobile_code", type: "varchar", nullable: true })
13054
+ (0, import_typeorm74.Column)({ name: "mobile_code", type: "varchar", nullable: true })
13093
13055
  ], Lead.prototype, "mobileCode", 2);
13094
13056
  __decorateClass([
13095
- (0, import_typeorm76.Column)({ name: "mobile", type: "varchar", nullable: true })
13057
+ (0, import_typeorm74.Column)({ name: "mobile", type: "varchar", nullable: true })
13096
13058
  ], Lead.prototype, "mobile", 2);
13097
13059
  __decorateClass([
13098
- (0, import_typeorm76.Column)({ name: "email", type: "varchar", nullable: true })
13060
+ (0, import_typeorm74.Column)({ name: "email", type: "varchar", nullable: true })
13099
13061
  ], Lead.prototype, "email", 2);
13100
13062
  __decorateClass([
13101
- (0, import_typeorm76.Column)({ name: "description", type: "varchar", nullable: true })
13063
+ (0, import_typeorm74.Column)({ name: "description", type: "varchar", nullable: true })
13102
13064
  ], Lead.prototype, "description", 2);
13103
13065
  __decorateClass([
13104
- (0, import_typeorm76.Column)({
13066
+ (0, import_typeorm74.Column)({
13105
13067
  name: "category",
13106
13068
  type: "enum",
13107
13069
  enum: CategoryEmum,
@@ -13109,129 +13071,129 @@ __decorateClass([
13109
13071
  })
13110
13072
  ], Lead.prototype, "category", 2);
13111
13073
  Lead = __decorateClass([
13112
- (0, import_typeorm76.Entity)("leads")
13074
+ (0, import_typeorm74.Entity)("leads")
13113
13075
  ], Lead);
13114
13076
 
13115
13077
  // src/entities/job-freelancer-recommendation.entity.ts
13116
- var import_typeorm77 = require("typeorm");
13078
+ var import_typeorm75 = require("typeorm");
13117
13079
  var JobFreelancerRecommendation = class {
13118
13080
  };
13119
13081
  __decorateClass([
13120
- (0, import_typeorm77.ViewColumn)({ name: "job_id" })
13082
+ (0, import_typeorm75.ViewColumn)({ name: "job_id" })
13121
13083
  ], JobFreelancerRecommendation.prototype, "jobId", 2);
13122
13084
  __decorateClass([
13123
- (0, import_typeorm77.ViewColumn)({ name: "job_uuid" })
13085
+ (0, import_typeorm75.ViewColumn)({ name: "job_uuid" })
13124
13086
  ], JobFreelancerRecommendation.prototype, "jobUuid", 2);
13125
13087
  __decorateClass([
13126
- (0, import_typeorm77.ViewColumn)({ name: "job_unique_id" })
13088
+ (0, import_typeorm75.ViewColumn)({ name: "job_unique_id" })
13127
13089
  ], JobFreelancerRecommendation.prototype, "jobUniqueId", 2);
13128
13090
  __decorateClass([
13129
- (0, import_typeorm77.ViewColumn)({ name: "job_role" })
13091
+ (0, import_typeorm75.ViewColumn)({ name: "job_role" })
13130
13092
  ], JobFreelancerRecommendation.prototype, "jobRole", 2);
13131
13093
  __decorateClass([
13132
- (0, import_typeorm77.ViewColumn)({ name: "job_openings" })
13094
+ (0, import_typeorm75.ViewColumn)({ name: "job_openings" })
13133
13095
  ], JobFreelancerRecommendation.prototype, "jobOpenings", 2);
13134
13096
  __decorateClass([
13135
- (0, import_typeorm77.ViewColumn)({ name: "job_location" })
13097
+ (0, import_typeorm75.ViewColumn)({ name: "job_location" })
13136
13098
  ], JobFreelancerRecommendation.prototype, "jobLocation", 2);
13137
13099
  __decorateClass([
13138
- (0, import_typeorm77.ViewColumn)({ name: "job_currency" })
13100
+ (0, import_typeorm75.ViewColumn)({ name: "job_currency" })
13139
13101
  ], JobFreelancerRecommendation.prototype, "jobCurrency", 2);
13140
13102
  __decorateClass([
13141
- (0, import_typeorm77.ViewColumn)({ name: "job_salary_from" })
13103
+ (0, import_typeorm75.ViewColumn)({ name: "job_salary_from" })
13142
13104
  ], JobFreelancerRecommendation.prototype, "jobSalaryFrom", 2);
13143
13105
  __decorateClass([
13144
- (0, import_typeorm77.ViewColumn)({ name: "job_salary_to" })
13106
+ (0, import_typeorm75.ViewColumn)({ name: "job_salary_to" })
13145
13107
  ], JobFreelancerRecommendation.prototype, "jobSalaryTo", 2);
13146
13108
  __decorateClass([
13147
- (0, import_typeorm77.ViewColumn)({ name: "job_employment_type" })
13109
+ (0, import_typeorm75.ViewColumn)({ name: "job_employment_type" })
13148
13110
  ], JobFreelancerRecommendation.prototype, "jobEmploymentType", 2);
13149
13111
  __decorateClass([
13150
- (0, import_typeorm77.ViewColumn)({ name: "application_received" })
13112
+ (0, import_typeorm75.ViewColumn)({ name: "application_received" })
13151
13113
  ], JobFreelancerRecommendation.prototype, "applicationReceived", 2);
13152
13114
  __decorateClass([
13153
- (0, import_typeorm77.ViewColumn)({ name: "job_posted_at" })
13115
+ (0, import_typeorm75.ViewColumn)({ name: "job_posted_at" })
13154
13116
  ], JobFreelancerRecommendation.prototype, "jobPostedAt", 2);
13155
13117
  __decorateClass([
13156
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_id" })
13118
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_id" })
13157
13119
  ], JobFreelancerRecommendation.prototype, "freelancerId", 2);
13158
13120
  __decorateClass([
13159
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_uuid" })
13121
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_uuid" })
13160
13122
  ], JobFreelancerRecommendation.prototype, "freelancerUuid", 2);
13161
13123
  __decorateClass([
13162
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_unique_id" })
13124
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_unique_id" })
13163
13125
  ], JobFreelancerRecommendation.prototype, "freelancerUniqueId", 2);
13164
13126
  __decorateClass([
13165
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_first_name" })
13127
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_first_name" })
13166
13128
  ], JobFreelancerRecommendation.prototype, "freelancerFirstName", 2);
13167
13129
  __decorateClass([
13168
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_last_name" })
13130
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_last_name" })
13169
13131
  ], JobFreelancerRecommendation.prototype, "freelancerLastName", 2);
13170
13132
  __decorateClass([
13171
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_email" })
13133
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_email" })
13172
13134
  ], JobFreelancerRecommendation.prototype, "freelancerEmail", 2);
13173
13135
  __decorateClass([
13174
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_profile_picture" })
13136
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_profile_picture" })
13175
13137
  ], JobFreelancerRecommendation.prototype, "freelancerProfilePicture", 2);
13176
13138
  __decorateClass([
13177
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_is_social" })
13139
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_is_social" })
13178
13140
  ], JobFreelancerRecommendation.prototype, "freelancerIsSocial", 2);
13179
13141
  __decorateClass([
13180
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_created_at" })
13142
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_created_at" })
13181
13143
  ], JobFreelancerRecommendation.prototype, "freelancerCreatedAt", 2);
13182
13144
  __decorateClass([
13183
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_designation" })
13145
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_designation" })
13184
13146
  ], JobFreelancerRecommendation.prototype, "freelancerDesignation", 2);
13185
13147
  __decorateClass([
13186
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_experience" })
13148
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_experience" })
13187
13149
  ], JobFreelancerRecommendation.prototype, "freelancerExperience", 2);
13188
13150
  __decorateClass([
13189
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_expertshub_verified" })
13151
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_expertshub_verified" })
13190
13152
  ], JobFreelancerRecommendation.prototype, "freelancerExpertshubVerified", 2);
13191
13153
  __decorateClass([
13192
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_hourly_compensation" })
13154
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_hourly_compensation" })
13193
13155
  ], JobFreelancerRecommendation.prototype, "freelancerHourlyCompensation", 2);
13194
13156
  __decorateClass([
13195
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_country_name" })
13157
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_country_name" })
13196
13158
  ], JobFreelancerRecommendation.prototype, "freelancerCountryName", 2);
13197
13159
  __decorateClass([
13198
- (0, import_typeorm77.ViewColumn)({ name: "freelancer_country_iso_code" })
13160
+ (0, import_typeorm75.ViewColumn)({ name: "freelancer_country_iso_code" })
13199
13161
  ], JobFreelancerRecommendation.prototype, "freelancerCountryIsoCode", 2);
13200
13162
  __decorateClass([
13201
- (0, import_typeorm77.ViewColumn)({ name: "client_id" })
13163
+ (0, import_typeorm75.ViewColumn)({ name: "client_id" })
13202
13164
  ], JobFreelancerRecommendation.prototype, "clientId", 2);
13203
13165
  __decorateClass([
13204
- (0, import_typeorm77.ViewColumn)({ name: "client_uuid" })
13166
+ (0, import_typeorm75.ViewColumn)({ name: "client_uuid" })
13205
13167
  ], JobFreelancerRecommendation.prototype, "clientUuid", 2);
13206
13168
  __decorateClass([
13207
- (0, import_typeorm77.ViewColumn)({ name: "client_first_name" })
13169
+ (0, import_typeorm75.ViewColumn)({ name: "client_first_name" })
13208
13170
  ], JobFreelancerRecommendation.prototype, "clientFirstName", 2);
13209
13171
  __decorateClass([
13210
- (0, import_typeorm77.ViewColumn)({ name: "client_last_name" })
13172
+ (0, import_typeorm75.ViewColumn)({ name: "client_last_name" })
13211
13173
  ], JobFreelancerRecommendation.prototype, "clientLastName", 2);
13212
13174
  __decorateClass([
13213
- (0, import_typeorm77.ViewColumn)({ name: "client_email" })
13175
+ (0, import_typeorm75.ViewColumn)({ name: "client_email" })
13214
13176
  ], JobFreelancerRecommendation.prototype, "clientEmail", 2);
13215
13177
  __decorateClass([
13216
- (0, import_typeorm77.ViewColumn)({ name: "client_company_logo" })
13178
+ (0, import_typeorm75.ViewColumn)({ name: "client_company_logo" })
13217
13179
  ], JobFreelancerRecommendation.prototype, "clientCompanyLogo", 2);
13218
13180
  __decorateClass([
13219
- (0, import_typeorm77.ViewColumn)({ name: "client_company_name" })
13181
+ (0, import_typeorm75.ViewColumn)({ name: "client_company_name" })
13220
13182
  ], JobFreelancerRecommendation.prototype, "clientCompanyName", 2);
13221
13183
  __decorateClass([
13222
- (0, import_typeorm77.ViewColumn)({ name: "matching_skills" })
13184
+ (0, import_typeorm75.ViewColumn)({ name: "matching_skills" })
13223
13185
  ], JobFreelancerRecommendation.prototype, "matchingSkills", 2);
13224
13186
  __decorateClass([
13225
- (0, import_typeorm77.ViewColumn)({ name: "matching_skills_count" })
13187
+ (0, import_typeorm75.ViewColumn)({ name: "matching_skills_count" })
13226
13188
  ], JobFreelancerRecommendation.prototype, "matchingSkillsCount", 2);
13227
13189
  __decorateClass([
13228
- (0, import_typeorm77.ViewColumn)({ name: "required_skills" })
13190
+ (0, import_typeorm75.ViewColumn)({ name: "required_skills" })
13229
13191
  ], JobFreelancerRecommendation.prototype, "requiredSkills", 2);
13230
13192
  __decorateClass([
13231
- (0, import_typeorm77.ViewColumn)({ name: "required_skills_count" })
13193
+ (0, import_typeorm75.ViewColumn)({ name: "required_skills_count" })
13232
13194
  ], JobFreelancerRecommendation.prototype, "requiredSkillsCount", 2);
13233
13195
  JobFreelancerRecommendation = __decorateClass([
13234
- (0, import_typeorm77.ViewEntity)({
13196
+ (0, import_typeorm75.ViewEntity)({
13235
13197
  name: "job_freelancer_recommendations",
13236
13198
  materialized: true,
13237
13199
  synchronize: false
@@ -13240,32 +13202,32 @@ JobFreelancerRecommendation = __decorateClass([
13240
13202
  ], JobFreelancerRecommendation);
13241
13203
 
13242
13204
  // src/entities/job-freelancer-recommendation-v2.entity.ts
13243
- var import_typeorm78 = require("typeorm");
13205
+ var import_typeorm76 = require("typeorm");
13244
13206
  var JobFreelancerRecommendationV2 = class {
13245
13207
  };
13246
13208
  __decorateClass([
13247
- (0, import_typeorm78.ViewColumn)({ name: "job_id" })
13209
+ (0, import_typeorm76.ViewColumn)({ name: "job_id" })
13248
13210
  ], JobFreelancerRecommendationV2.prototype, "jobId", 2);
13249
13211
  __decorateClass([
13250
- (0, import_typeorm78.ViewColumn)({ name: "job_owner_id" })
13212
+ (0, import_typeorm76.ViewColumn)({ name: "job_owner_id" })
13251
13213
  ], JobFreelancerRecommendationV2.prototype, "jobOwnerId", 2);
13252
13214
  __decorateClass([
13253
- (0, import_typeorm78.ViewColumn)({ name: "freelancer_id" })
13215
+ (0, import_typeorm76.ViewColumn)({ name: "freelancer_id" })
13254
13216
  ], JobFreelancerRecommendationV2.prototype, "freelancerId", 2);
13255
13217
  __decorateClass([
13256
- (0, import_typeorm78.ViewColumn)({ name: "matching_skills" })
13218
+ (0, import_typeorm76.ViewColumn)({ name: "matching_skills" })
13257
13219
  ], JobFreelancerRecommendationV2.prototype, "matchingSkills", 2);
13258
13220
  __decorateClass([
13259
- (0, import_typeorm78.ViewColumn)({ name: "matching_skills_count" })
13221
+ (0, import_typeorm76.ViewColumn)({ name: "matching_skills_count" })
13260
13222
  ], JobFreelancerRecommendationV2.prototype, "matchingSkillsCount", 2);
13261
13223
  __decorateClass([
13262
- (0, import_typeorm78.ViewColumn)({ name: "required_skills" })
13224
+ (0, import_typeorm76.ViewColumn)({ name: "required_skills" })
13263
13225
  ], JobFreelancerRecommendationV2.prototype, "requiredSkills", 2);
13264
13226
  __decorateClass([
13265
- (0, import_typeorm78.ViewColumn)({ name: "required_skills_count" })
13227
+ (0, import_typeorm76.ViewColumn)({ name: "required_skills_count" })
13266
13228
  ], JobFreelancerRecommendationV2.prototype, "requiredSkillsCount", 2);
13267
13229
  JobFreelancerRecommendationV2 = __decorateClass([
13268
- (0, import_typeorm78.ViewEntity)({
13230
+ (0, import_typeorm76.ViewEntity)({
13269
13231
  name: "job_freelancer_recommendations_v2",
13270
13232
  materialized: true,
13271
13233
  synchronize: false
@@ -13274,74 +13236,74 @@ JobFreelancerRecommendationV2 = __decorateClass([
13274
13236
  ], JobFreelancerRecommendationV2);
13275
13237
 
13276
13238
  // src/entities/client-freelancer-recommendation.entity.ts
13277
- var import_typeorm79 = require("typeorm");
13239
+ var import_typeorm77 = require("typeorm");
13278
13240
  var ClientFreelancerRecommendation = class {
13279
13241
  };
13280
13242
  __decorateClass([
13281
- (0, import_typeorm79.ViewColumn)({ name: "client_id" })
13243
+ (0, import_typeorm77.ViewColumn)({ name: "client_id" })
13282
13244
  ], ClientFreelancerRecommendation.prototype, "clientId", 2);
13283
13245
  __decorateClass([
13284
- (0, import_typeorm79.ViewColumn)({ name: "client_uuid" })
13246
+ (0, import_typeorm77.ViewColumn)({ name: "client_uuid" })
13285
13247
  ], ClientFreelancerRecommendation.prototype, "clientUuid", 2);
13286
13248
  __decorateClass([
13287
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_id" })
13249
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_id" })
13288
13250
  ], ClientFreelancerRecommendation.prototype, "freelancerId", 2);
13289
13251
  __decorateClass([
13290
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_uuid" })
13252
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_uuid" })
13291
13253
  ], ClientFreelancerRecommendation.prototype, "freelancerUuid", 2);
13292
13254
  __decorateClass([
13293
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_unique_id" })
13255
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_unique_id" })
13294
13256
  ], ClientFreelancerRecommendation.prototype, "freelancerUniqueId", 2);
13295
13257
  __decorateClass([
13296
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_first_name" })
13258
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_first_name" })
13297
13259
  ], ClientFreelancerRecommendation.prototype, "freelancerFirstName", 2);
13298
13260
  __decorateClass([
13299
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_last_name" })
13261
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_last_name" })
13300
13262
  ], ClientFreelancerRecommendation.prototype, "freelancerLastName", 2);
13301
13263
  __decorateClass([
13302
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_email" })
13264
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_email" })
13303
13265
  ], ClientFreelancerRecommendation.prototype, "freelancerEmail", 2);
13304
13266
  __decorateClass([
13305
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_profile_picture" })
13267
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_profile_picture" })
13306
13268
  ], ClientFreelancerRecommendation.prototype, "freelancerProfilePicture", 2);
13307
13269
  __decorateClass([
13308
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_is_social" })
13270
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_is_social" })
13309
13271
  ], ClientFreelancerRecommendation.prototype, "freelancerIsSocial", 2);
13310
13272
  __decorateClass([
13311
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_created_at" })
13273
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_created_at" })
13312
13274
  ], ClientFreelancerRecommendation.prototype, "freelancerCreatedAt", 2);
13313
13275
  __decorateClass([
13314
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_designation" })
13276
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_designation" })
13315
13277
  ], ClientFreelancerRecommendation.prototype, "freelancerDesignation", 2);
13316
13278
  __decorateClass([
13317
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_experience" })
13279
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_experience" })
13318
13280
  ], ClientFreelancerRecommendation.prototype, "freelancerExperience", 2);
13319
13281
  __decorateClass([
13320
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_expertshub_verified" })
13282
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_expertshub_verified" })
13321
13283
  ], ClientFreelancerRecommendation.prototype, "freelancerExpertshubVerified", 2);
13322
13284
  __decorateClass([
13323
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_hourly_compensation" })
13285
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_hourly_compensation" })
13324
13286
  ], ClientFreelancerRecommendation.prototype, "freelancerHourlyCompensation", 2);
13325
13287
  __decorateClass([
13326
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_country_name" })
13288
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_country_name" })
13327
13289
  ], ClientFreelancerRecommendation.prototype, "freelancerCountryName", 2);
13328
13290
  __decorateClass([
13329
- (0, import_typeorm79.ViewColumn)({ name: "freelancer_country_iso_code" })
13291
+ (0, import_typeorm77.ViewColumn)({ name: "freelancer_country_iso_code" })
13330
13292
  ], ClientFreelancerRecommendation.prototype, "freelancerCountryIsoCode", 2);
13331
13293
  __decorateClass([
13332
- (0, import_typeorm79.ViewColumn)({ name: "matching_skills" })
13294
+ (0, import_typeorm77.ViewColumn)({ name: "matching_skills" })
13333
13295
  ], ClientFreelancerRecommendation.prototype, "matchingSkills", 2);
13334
13296
  __decorateClass([
13335
- (0, import_typeorm79.ViewColumn)({ name: "matching_skills_count" })
13297
+ (0, import_typeorm77.ViewColumn)({ name: "matching_skills_count" })
13336
13298
  ], ClientFreelancerRecommendation.prototype, "matchingSkillsCount", 2);
13337
13299
  __decorateClass([
13338
- (0, import_typeorm79.ViewColumn)({ name: "required_skills" })
13300
+ (0, import_typeorm77.ViewColumn)({ name: "required_skills" })
13339
13301
  ], ClientFreelancerRecommendation.prototype, "requiredSkills", 2);
13340
13302
  __decorateClass([
13341
- (0, import_typeorm79.ViewColumn)({ name: "required_skills_count" })
13303
+ (0, import_typeorm77.ViewColumn)({ name: "required_skills_count" })
13342
13304
  ], ClientFreelancerRecommendation.prototype, "requiredSkillsCount", 2);
13343
13305
  ClientFreelancerRecommendation = __decorateClass([
13344
- (0, import_typeorm79.ViewEntity)({
13306
+ (0, import_typeorm77.ViewEntity)({
13345
13307
  name: "client_freelancer_recommendations",
13346
13308
  materialized: true,
13347
13309
  synchronize: false
@@ -13350,7 +13312,7 @@ ClientFreelancerRecommendation = __decorateClass([
13350
13312
  ], ClientFreelancerRecommendation);
13351
13313
 
13352
13314
  // src/entities/commission.entity.ts
13353
- var import_typeorm80 = require("typeorm");
13315
+ var import_typeorm78 = require("typeorm");
13354
13316
  var CommissionTypeEnum = /* @__PURE__ */ ((CommissionTypeEnum2) => {
13355
13317
  CommissionTypeEnum2["PERCENTAGE"] = "PERCENTAGE";
13356
13318
  CommissionTypeEnum2["FLAT"] = "FLAT";
@@ -13359,7 +13321,7 @@ var CommissionTypeEnum = /* @__PURE__ */ ((CommissionTypeEnum2) => {
13359
13321
  var Commission = class extends BaseEntity {
13360
13322
  };
13361
13323
  __decorateClass([
13362
- (0, import_typeorm80.Column)({
13324
+ (0, import_typeorm78.Column)({
13363
13325
  name: "freelancer_commission_type",
13364
13326
  type: "enum",
13365
13327
  enum: CommissionTypeEnum,
@@ -13367,10 +13329,10 @@ __decorateClass([
13367
13329
  })
13368
13330
  ], Commission.prototype, "freelancerCommissionType", 2);
13369
13331
  __decorateClass([
13370
- (0, import_typeorm80.Column)({ name: "freelancer_commission", type: "integer", default: 0 })
13332
+ (0, import_typeorm78.Column)({ name: "freelancer_commission", type: "integer", default: 0 })
13371
13333
  ], Commission.prototype, "freelancerCommission", 2);
13372
13334
  __decorateClass([
13373
- (0, import_typeorm80.Column)({
13335
+ (0, import_typeorm78.Column)({
13374
13336
  name: "client_commission_type",
13375
13337
  type: "enum",
13376
13338
  enum: CommissionTypeEnum,
@@ -13378,50 +13340,50 @@ __decorateClass([
13378
13340
  })
13379
13341
  ], Commission.prototype, "clientCommissionType", 2);
13380
13342
  __decorateClass([
13381
- (0, import_typeorm80.Column)({ name: "client_commission", type: "integer", default: 0 })
13343
+ (0, import_typeorm78.Column)({ name: "client_commission", type: "integer", default: 0 })
13382
13344
  ], Commission.prototype, "clientCommission", 2);
13383
13345
  Commission = __decorateClass([
13384
- (0, import_typeorm80.Entity)("commissions")
13346
+ (0, import_typeorm78.Entity)("commissions")
13385
13347
  ], Commission);
13386
13348
 
13387
13349
  // src/entities/calendly-meeting-log.entity.ts
13388
- var import_typeorm81 = require("typeorm");
13350
+ var import_typeorm79 = require("typeorm");
13389
13351
  var CalendlyMeetingLog = class extends BaseEntity {
13390
13352
  };
13391
13353
  __decorateClass([
13392
- (0, import_typeorm81.Column)({ name: "calendly_event_id", type: "varchar", nullable: true }),
13393
- (0, import_typeorm81.Index)()
13354
+ (0, import_typeorm79.Column)({ name: "calendly_event_id", type: "varchar", nullable: true }),
13355
+ (0, import_typeorm79.Index)()
13394
13356
  ], CalendlyMeetingLog.prototype, "calendlyEventId", 2);
13395
13357
  __decorateClass([
13396
- (0, import_typeorm81.Column)({ name: "calendly_event_type", type: "varchar", nullable: true })
13358
+ (0, import_typeorm79.Column)({ name: "calendly_event_type", type: "varchar", nullable: true })
13397
13359
  ], CalendlyMeetingLog.prototype, "calendlyEventType", 2);
13398
13360
  __decorateClass([
13399
- (0, import_typeorm81.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13361
+ (0, import_typeorm79.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13400
13362
  ], CalendlyMeetingLog.prototype, "rawWebhookData", 2);
13401
13363
  CalendlyMeetingLog = __decorateClass([
13402
- (0, import_typeorm81.Entity)("calendly_meeting_logs")
13364
+ (0, import_typeorm79.Entity)("calendly_meeting_logs")
13403
13365
  ], CalendlyMeetingLog);
13404
13366
 
13405
13367
  // src/entities/zoom-meeting-log.entity.ts
13406
- var import_typeorm82 = require("typeorm");
13368
+ var import_typeorm80 = require("typeorm");
13407
13369
  var ZoomMeetingLog = class extends BaseEntity {
13408
13370
  };
13409
13371
  __decorateClass([
13410
- (0, import_typeorm82.Column)({ name: "zoom_meeting_id", type: "varchar", nullable: true }),
13411
- (0, import_typeorm82.Index)()
13372
+ (0, import_typeorm80.Column)({ name: "zoom_meeting_id", type: "varchar", nullable: true }),
13373
+ (0, import_typeorm80.Index)()
13412
13374
  ], ZoomMeetingLog.prototype, "zoomMeetingId", 2);
13413
13375
  __decorateClass([
13414
- (0, import_typeorm82.Column)({ name: "zoom_event_type", type: "varchar", nullable: true })
13376
+ (0, import_typeorm80.Column)({ name: "zoom_event_type", type: "varchar", nullable: true })
13415
13377
  ], ZoomMeetingLog.prototype, "zoomEventType", 2);
13416
13378
  __decorateClass([
13417
- (0, import_typeorm82.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13379
+ (0, import_typeorm80.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13418
13380
  ], ZoomMeetingLog.prototype, "rawWebhookData", 2);
13419
13381
  ZoomMeetingLog = __decorateClass([
13420
- (0, import_typeorm82.Entity)("zoom_meeting_logs")
13382
+ (0, import_typeorm80.Entity)("zoom_meeting_logs")
13421
13383
  ], ZoomMeetingLog);
13422
13384
 
13423
13385
  // src/entities/docuseal.entity.ts
13424
- var import_typeorm83 = require("typeorm");
13386
+ var import_typeorm81 = require("typeorm");
13425
13387
  var DocuSealTypeEnum = /* @__PURE__ */ ((DocuSealTypeEnum2) => {
13426
13388
  DocuSealTypeEnum2["FREELANCER_SERVICE_AGGREMENT"] = "FREELANCER_SERVICE_AGGREMENT";
13427
13389
  DocuSealTypeEnum2["CLIENT_SERVICE_AGGREMENT"] = "CLIENT_SERVICE_AGGREMENT";
@@ -13431,87 +13393,298 @@ var DocuSealTypeEnum = /* @__PURE__ */ ((DocuSealTypeEnum2) => {
13431
13393
  var DocuSeal = class extends BaseEntity {
13432
13394
  };
13433
13395
  __decorateClass([
13434
- (0, import_typeorm83.Column)({ name: "reference_id", type: "integer", nullable: false }),
13435
- (0, import_typeorm83.Index)()
13396
+ (0, import_typeorm81.Column)({ name: "reference_id", type: "integer", nullable: false }),
13397
+ (0, import_typeorm81.Index)()
13436
13398
  ], DocuSeal.prototype, "referenceId", 2);
13437
13399
  __decorateClass([
13438
- (0, import_typeorm83.Column)({ name: "submitter_id", type: "integer", nullable: true }),
13439
- (0, import_typeorm83.Index)()
13400
+ (0, import_typeorm81.Column)({ name: "submitter_id", type: "integer", nullable: true }),
13401
+ (0, import_typeorm81.Index)()
13440
13402
  ], DocuSeal.prototype, "submitterId", 2);
13441
13403
  __decorateClass([
13442
- (0, import_typeorm83.Column)({ name: "submitter_response", type: "jsonb", nullable: true })
13404
+ (0, import_typeorm81.Column)({ name: "submitter_response", type: "jsonb", nullable: true })
13443
13405
  ], DocuSeal.prototype, "submitterResponse", 2);
13444
13406
  __decorateClass([
13445
- (0, import_typeorm83.Column)({ name: "webhook_response", type: "jsonb", nullable: true })
13407
+ (0, import_typeorm81.Column)({ name: "webhook_response", type: "jsonb", nullable: true })
13446
13408
  ], DocuSeal.prototype, "webhookResponse", 2);
13447
13409
  __decorateClass([
13448
- (0, import_typeorm83.Column)({ name: "type", type: "enum", enum: DocuSealTypeEnum, nullable: true })
13410
+ (0, import_typeorm81.Column)({ name: "type", type: "enum", enum: DocuSealTypeEnum, nullable: true })
13449
13411
  ], DocuSeal.prototype, "type", 2);
13450
13412
  DocuSeal = __decorateClass([
13451
- (0, import_typeorm83.Entity)("docuseal")
13413
+ (0, import_typeorm81.Entity)("docuseal")
13452
13414
  ], DocuSeal);
13453
13415
 
13454
13416
  // src/entities/stripe-logs.entity.ts
13455
- var import_typeorm84 = require("typeorm");
13417
+ var import_typeorm82 = require("typeorm");
13456
13418
  var StripeLog = class extends BaseEntity {
13457
13419
  };
13458
13420
  __decorateClass([
13459
- (0, import_typeorm84.Column)({ name: "stripe_event_id", type: "varchar", nullable: true })
13421
+ (0, import_typeorm82.Column)({ name: "stripe_event_id", type: "varchar", nullable: true })
13460
13422
  ], StripeLog.prototype, "stripeEventId", 2);
13461
13423
  __decorateClass([
13462
- (0, import_typeorm84.Column)({ name: "event_type", type: "varchar", nullable: true })
13424
+ (0, import_typeorm82.Column)({ name: "event_type", type: "varchar", nullable: true })
13463
13425
  ], StripeLog.prototype, "eventType", 2);
13464
13426
  __decorateClass([
13465
- (0, import_typeorm84.Column)({ name: "stripe_account_id", type: "varchar", nullable: true })
13427
+ (0, import_typeorm82.Column)({ name: "stripe_account_id", type: "varchar", nullable: true })
13466
13428
  ], StripeLog.prototype, "stripeAccountId", 2);
13467
13429
  __decorateClass([
13468
- (0, import_typeorm84.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13430
+ (0, import_typeorm82.Column)({ name: "raw_webhook_data", type: "jsonb", nullable: true })
13469
13431
  ], StripeLog.prototype, "rawWebhookData", 2);
13470
13432
  StripeLog = __decorateClass([
13471
- (0, import_typeorm84.Entity)("stripe_logs")
13433
+ (0, import_typeorm82.Entity)("stripe_logs")
13472
13434
  ], StripeLog);
13473
13435
 
13474
13436
  // src/entities/recommendation-weightage-config.entity.ts
13475
- var import_typeorm85 = require("typeorm");
13437
+ var import_typeorm83 = require("typeorm");
13476
13438
  var RecommendationWeightageConfig = class extends BaseEntity {
13477
13439
  };
13478
13440
  __decorateClass([
13479
- (0, import_typeorm85.Column)({
13441
+ (0, import_typeorm83.Column)({
13480
13442
  type: "varchar",
13481
13443
  length: 100,
13482
13444
  unique: true,
13483
13445
  comment: "Unique key identifier (e.g., full_time_weights, hourly_weights)"
13484
13446
  }),
13485
- (0, import_typeorm85.Index)()
13447
+ (0, import_typeorm83.Index)()
13486
13448
  ], RecommendationWeightageConfig.prototype, "key", 2);
13487
13449
  __decorateClass([
13488
- (0, import_typeorm85.Column)({
13450
+ (0, import_typeorm83.Column)({
13489
13451
  type: "jsonb",
13490
13452
  comment: "JSON object containing weight values",
13491
13453
  nullable: true
13492
13454
  })
13493
13455
  ], RecommendationWeightageConfig.prototype, "value", 2);
13494
13456
  __decorateClass([
13495
- (0, import_typeorm85.Column)({ name: "is_active", type: "boolean", default: true })
13457
+ (0, import_typeorm83.Column)({ name: "is_active", type: "boolean", default: true })
13496
13458
  ], RecommendationWeightageConfig.prototype, "isActive", 2);
13497
13459
  RecommendationWeightageConfig = __decorateClass([
13498
- (0, import_typeorm85.Entity)("recommendation_weightage_configs")
13460
+ (0, import_typeorm83.Entity)("recommendation_weightage_configs")
13499
13461
  ], RecommendationWeightageConfig);
13500
13462
 
13501
13463
  // src/entities/global-setting.entity.ts
13502
- var import_typeorm86 = require("typeorm");
13464
+ var import_typeorm84 = require("typeorm");
13503
13465
  var GlobalSetting = class extends BaseEntity {
13504
13466
  };
13505
13467
  __decorateClass([
13506
- (0, import_typeorm86.Column)({ name: "key", type: "varchar", length: 255, nullable: false, unique: true })
13468
+ (0, import_typeorm84.Column)({ name: "key", type: "varchar", length: 255, nullable: false, unique: true })
13507
13469
  ], GlobalSetting.prototype, "key", 2);
13508
13470
  __decorateClass([
13509
- (0, import_typeorm86.Column)({ name: "value", type: "text", nullable: false })
13471
+ (0, import_typeorm84.Column)({ name: "value", type: "text", nullable: false })
13510
13472
  ], GlobalSetting.prototype, "value", 2);
13511
13473
  GlobalSetting = __decorateClass([
13512
- (0, import_typeorm86.Entity)("global_settings"),
13513
- (0, import_typeorm86.Index)(["key"], { unique: true })
13474
+ (0, import_typeorm84.Entity)("global_settings"),
13475
+ (0, import_typeorm84.Index)(["key"], { unique: true })
13514
13476
  ], GlobalSetting);
13477
+
13478
+ // src/entities/plan.entity.ts
13479
+ var import_typeorm87 = require("typeorm");
13480
+
13481
+ // src/entities/plan-feature.entity.ts
13482
+ var import_typeorm85 = require("typeorm");
13483
+ var PlanFeature = class extends BaseEntity {
13484
+ };
13485
+ // individual index to find features by plan
13486
+ __decorateClass([
13487
+ (0, import_typeorm85.Column)({ name: "plan_id", type: "integer", nullable: false }),
13488
+ (0, import_typeorm85.Index)()
13489
+ ], PlanFeature.prototype, "planId", 2);
13490
+ __decorateClass([
13491
+ (0, import_typeorm85.ManyToOne)(() => Plan, (plan) => plan.features, {
13492
+ onDelete: "CASCADE",
13493
+ nullable: false
13494
+ }),
13495
+ (0, import_typeorm85.JoinColumn)({ name: "plan_id" })
13496
+ ], PlanFeature.prototype, "plan", 2);
13497
+ __decorateClass([
13498
+ (0, import_typeorm85.Column)({ name: "label", type: "varchar", length: 200 })
13499
+ ], PlanFeature.prototype, "label", 2);
13500
+ __decorateClass([
13501
+ (0, import_typeorm85.Column)({ name: "tooltip", type: "varchar", length: 300, nullable: true })
13502
+ ], PlanFeature.prototype, "tooltip", 2);
13503
+ __decorateClass([
13504
+ (0, import_typeorm85.Column)({ name: "sort_order", type: "smallint", default: 0 })
13505
+ ], PlanFeature.prototype, "sortOrder", 2);
13506
+ __decorateClass([
13507
+ (0, import_typeorm85.Column)({ name: "is_active", type: "boolean", default: true })
13508
+ ], PlanFeature.prototype, "isActive", 2);
13509
+ PlanFeature = __decorateClass([
13510
+ (0, import_typeorm85.Entity)("plan_features"),
13511
+ (0, import_typeorm85.Index)("idx_plan_features_plan_id", ["plan"]),
13512
+ (0, import_typeorm85.Index)("idx_plan_features_plan_sort", ["plan", "sort_order"]),
13513
+ (0, import_typeorm85.Check)("chk_plan_features_sort_order_positive", '"sort_order" >= 0')
13514
+ ], PlanFeature);
13515
+
13516
+ // src/entities/plan-pricing.entity.ts
13517
+ var import_typeorm86 = require("typeorm");
13518
+ var BillingCycle = /* @__PURE__ */ ((BillingCycle2) => {
13519
+ BillingCycle2["MONTHLY"] = "monthly";
13520
+ BillingCycle2["YEARLY"] = "yearly";
13521
+ return BillingCycle2;
13522
+ })(BillingCycle || {});
13523
+ var PlanPricing = class extends BaseEntity {
13524
+ sanitize() {
13525
+ if (this.currency) {
13526
+ this.currency = this.currency.toUpperCase().trim();
13527
+ }
13528
+ if (this.price !== void 0 && this.price !== null) {
13529
+ this.price = parseFloat(this.price);
13530
+ }
13531
+ if (this.originalPrice !== void 0 && this.originalPrice !== null) {
13532
+ this.originalPrice = parseFloat(
13533
+ this.originalPrice
13534
+ );
13535
+ }
13536
+ if (this.isFree) {
13537
+ this.price = 0;
13538
+ this.originalPrice = null;
13539
+ this.discountPct = null;
13540
+ this.stripePriceId = null;
13541
+ }
13542
+ }
13543
+ /**
13544
+ * Returns the per-month display price regardless of billing cycle.
13545
+ * Use this in the frontend transform layer or API response DTOs.
13546
+ *
13547
+ * monthly → price (e.g. $29.99)
13548
+ * yearly → price / 12 (e.g. $22.79)
13549
+ *
13550
+ * Returns null for free plans.
13551
+ */
13552
+ get monthlyEquivalent() {
13553
+ if (this.isFree) return null;
13554
+ if (this.billingCycle === "yearly" /* YEARLY */) {
13555
+ return Math.round(this.price / 12 * 100) / 100;
13556
+ }
13557
+ return this.price;
13558
+ }
13559
+ /**
13560
+ * Returns the absolute saving vs original_price for this cycle.
13561
+ * Returns null if no original_price is set.
13562
+ */
13563
+ get savingsAmount() {
13564
+ if (this.originalPrice === null || this.originalPrice === void 0) {
13565
+ return null;
13566
+ }
13567
+ return Math.round((this.originalPrice - this.price) * 100) / 100;
13568
+ }
13569
+ };
13570
+ // individual index to find pricing by plan
13571
+ __decorateClass([
13572
+ (0, import_typeorm86.Column)({ name: "plan_id", type: "integer", nullable: false }),
13573
+ (0, import_typeorm86.Index)()
13574
+ ], PlanPricing.prototype, "planId", 2);
13575
+ __decorateClass([
13576
+ (0, import_typeorm86.ManyToOne)(() => Plan, (plan) => plan.pricing, {
13577
+ onDelete: "CASCADE",
13578
+ nullable: false
13579
+ }),
13580
+ (0, import_typeorm86.JoinColumn)({ name: "plan_id" })
13581
+ ], PlanPricing.prototype, "plan", 2);
13582
+ __decorateClass([
13583
+ (0, import_typeorm86.Column)({
13584
+ name: "billing_cycle",
13585
+ type: "enum",
13586
+ enum: BillingCycle
13587
+ })
13588
+ ], PlanPricing.prototype, "billingCycle", 2);
13589
+ __decorateClass([
13590
+ (0, import_typeorm86.Column)({ name: "price", type: "decimal", precision: 10, scale: 2, default: 0 })
13591
+ ], PlanPricing.prototype, "price", 2);
13592
+ __decorateClass([
13593
+ (0, import_typeorm86.Column)({ name: "original_price", type: "decimal", precision: 10, scale: 2, nullable: true })
13594
+ ], PlanPricing.prototype, "originalPrice", 2);
13595
+ __decorateClass([
13596
+ (0, import_typeorm86.Column)({ name: "discount_pct", type: "smallint", nullable: true })
13597
+ ], PlanPricing.prototype, "discountPct", 2);
13598
+ __decorateClass([
13599
+ (0, import_typeorm86.Column)({ name: "currency", type: "varchar", length: 3, default: "USD" })
13600
+ ], PlanPricing.prototype, "currency", 2);
13601
+ __decorateClass([
13602
+ (0, import_typeorm86.Column)({ name: "is_free", type: "boolean", default: false })
13603
+ ], PlanPricing.prototype, "isFree", 2);
13604
+ __decorateClass([
13605
+ (0, import_typeorm86.Column)({ name: "stripe_price_id", type: "varchar", length: 100, nullable: true, unique: true })
13606
+ ], PlanPricing.prototype, "stripePriceId", 2);
13607
+ __decorateClass([
13608
+ (0, import_typeorm86.Column)({ name: "trial_days", type: "smallint", default: 0 })
13609
+ ], PlanPricing.prototype, "trialDays", 2);
13610
+ __decorateClass([
13611
+ (0, import_typeorm86.Column)({ name: "is_active", type: "boolean", default: true })
13612
+ ], PlanPricing.prototype, "isActive", 2);
13613
+ __decorateClass([
13614
+ (0, import_typeorm86.BeforeInsert)(),
13615
+ (0, import_typeorm86.BeforeUpdate)()
13616
+ ], PlanPricing.prototype, "sanitize", 1);
13617
+ PlanPricing = __decorateClass([
13618
+ (0, import_typeorm86.Entity)("plan_pricings"),
13619
+ (0, import_typeorm86.Unique)("uq_plan_pricings_plan_cycle", ["planId", "billingCycle"]),
13620
+ (0, import_typeorm86.Index)("idx_plan_pricings_plan_id", ["planId"]),
13621
+ (0, import_typeorm86.Index)("idx_plan_pricings_active", ["isActive", "billingCycle"]),
13622
+ (0, import_typeorm86.Check)("chk_plan_pricings_price_non_negative", '"price" >= 0'),
13623
+ (0, import_typeorm86.Check)(
13624
+ "chk_plan_pricings_original_price_non_negative",
13625
+ '"originalPrice" IS NULL OR "originalPrice" >= 0'
13626
+ ),
13627
+ (0, import_typeorm86.Check)(
13628
+ "chk_plan_pricings_original_gte_price",
13629
+ '"originalPrice" IS NULL OR "originalPrice" >= "price"'
13630
+ ),
13631
+ (0, import_typeorm86.Check)(
13632
+ "chk_plan_pricings_discount_range",
13633
+ '"discountPct" IS NULL OR ("discountPct" >= 1 AND "discountPct" <= 99)'
13634
+ ),
13635
+ (0, import_typeorm86.Check)("chk_plan_pricings_trial_days_non_negative", '"trialDays" >= 0'),
13636
+ (0, import_typeorm86.Check)(
13637
+ "chk_plan_pricings_free_price_zero",
13638
+ '("isFree" = false) OR ("isFree" = true AND "price" = 0)'
13639
+ )
13640
+ ], PlanPricing);
13641
+
13642
+ // src/entities/plan.entity.ts
13643
+ var Plan = class extends BaseEntity {
13644
+ createSlug() {
13645
+ if (!this.slug && this.name) {
13646
+ this.slug = this.name.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "");
13647
+ }
13648
+ }
13649
+ };
13650
+ __decorateClass([
13651
+ (0, import_typeorm87.Column)({ name: "name", type: "varchar", length: 100 })
13652
+ ], Plan.prototype, "name", 2);
13653
+ __decorateClass([
13654
+ (0, import_typeorm87.Column)({ name: "slug", type: "varchar", length: 100 })
13655
+ ], Plan.prototype, "slug", 2);
13656
+ __decorateClass([
13657
+ (0, import_typeorm87.Column)({ name: "badge_label", type: "varchar", length: 60, nullable: true })
13658
+ ], Plan.prototype, "badgeLabel", 2);
13659
+ __decorateClass([
13660
+ (0, import_typeorm87.Column)({ name: "sort_order", type: "smallint", default: 0 })
13661
+ ], Plan.prototype, "sortOrder", 2);
13662
+ __decorateClass([
13663
+ (0, import_typeorm87.Column)({ name: "is_active", type: "boolean", default: true })
13664
+ ], Plan.prototype, "isActive", 2);
13665
+ __decorateClass([
13666
+ (0, import_typeorm87.Column)({ name: "metadata", type: "jsonb", default: {} })
13667
+ ], Plan.prototype, "metadata", 2);
13668
+ __decorateClass([
13669
+ (0, import_typeorm87.BeforeInsert)(),
13670
+ (0, import_typeorm87.BeforeUpdate)()
13671
+ ], Plan.prototype, "createSlug", 1);
13672
+ __decorateClass([
13673
+ (0, import_typeorm87.OneToMany)(() => PlanFeature, (feature) => feature.plan, {
13674
+ cascade: ["insert", "update"]
13675
+ })
13676
+ ], Plan.prototype, "features", 2);
13677
+ __decorateClass([
13678
+ (0, import_typeorm87.OneToMany)(() => PlanPricing, (pricing) => pricing.plan, {
13679
+ cascade: ["insert", "update"]
13680
+ })
13681
+ ], Plan.prototype, "pricing", 2);
13682
+ Plan = __decorateClass([
13683
+ (0, import_typeorm87.Entity)("plans"),
13684
+ (0, import_typeorm87.Index)("idx_plans_slug", ["slug"], { unique: true, where: '"is_deleted" IS FALSE' }),
13685
+ (0, import_typeorm87.Index)("idx_plans_active_sort", ["isActive", "sortOrder"]),
13686
+ (0, import_typeorm87.Check)("chk_plans_sort_order_positive", '"sortOrder" >= 0')
13687
+ ], Plan);
13515
13688
  // Annotate the CommonJS export names for ESM import in node:
13516
13689
  0 && (module.exports = {
13517
13690
  ADMIN_FREELANCER_PATTERN,
@@ -13563,6 +13736,7 @@ GlobalSetting = __decorateClass([
13563
13736
  BankAccountTypeEnum,
13564
13737
  BankDetail,
13565
13738
  BaseEntity,
13739
+ BillingCycle,
13566
13740
  BillingCycleEnum,
13567
13741
  CALENDLY_PATTERN,
13568
13742
  CITY_PATTERN,
@@ -13679,7 +13853,6 @@ GlobalSetting = __decorateClass([
13679
13853
  FREELANCER_EXPERIENCE_PATTERN,
13680
13854
  FREELANCER_PROJECT_PATTERN,
13681
13855
  FREELANCER_SKILL_PATTERN,
13682
- Feature,
13683
13856
  FetchClientInfoForChatDto,
13684
13857
  FetchFreelancerInfoForChatDto,
13685
13858
  ForgotPasswordDto,
@@ -13799,6 +13972,8 @@ GlobalSetting = __decorateClass([
13799
13972
  PROFILE_PATTERN,
13800
13973
  Permission,
13801
13974
  Plan,
13975
+ PlanFeature,
13976
+ PlanPricing,
13802
13977
  PreCheckoutCalculationDto,
13803
13978
  ProjectDto,
13804
13979
  Provider,