refactor: convert getBusyTimes to service class with dependency injection (#22949)

* refactor: convert getBusyTimes to service class with dependency injection

- Create BusyTimesService following UserAvailabilityService pattern
- Add DI tokens, module, and container setup for BusyTimesService
- Update all usage locations to use service instead of direct function calls
- Maintain existing function signatures for backward compatibility
- Add legacy exports to ensure smooth transition
- Update type references in trpc util to use service prototype
- Fix linting issues by making legacy exports async with proper imports
- All tests pass and type checking succeeds

Co-Authored-By: [email protected] <[email protected]>

* refactor: busy time service

* fix: api v2 eslint plugins version mismatch

* chore: bump platform libs

* chore: bump platform libs

* fix: missing di busyTimesModule in slots service

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-08-08 12:14:08 +03:00
1 parent 3ea73e75d6
commit 29314cde75
19 files changed
+533 -384

No files matched your search

+87 -12
View File
@@ -2500,7 +2500,7 @@ __metadata:
"@axiomhq/winston": ^1.2.0
"@calcom/platform-constants": "*"
"@calcom/platform-enums": "*"
"@calcom/platform-libraries": "npm:@calcom/[email protected]88"
"@calcom/platform-libraries": "npm:@calcom/[email protected]91"
"@calcom/platform-types": "*"
"@calcom/platform-utils": "*"
"@calcom/prisma": "*"
@@ -2531,6 +2531,8 @@ __metadata:
"@types/luxon": ^3.3.7
"@types/passport-jwt": ^3.0.13
"@types/supertest": ^2.0.12
"@typescript-eslint/eslint-plugin": ^6
"@typescript-eslint/parser": ^6
body-parser: ^1.20.2
bull: ^4.12.4
class-transformer: ^0.5.1
@@ -3556,13 +3558,13 @@ __metadata:
languageName: unknown
linkType: soft
"@calcom/platform-libraries@npm:@calcom/[email protected]88":
version: 0.0.288
resolution: "@calcom/platform-libraries@npm:0.0.288"
"@calcom/platform-libraries@npm:@calcom/[email protected]91":
version: 0.0.291
resolution: "@calcom/platform-libraries@npm:0.0.291"
dependencies:
"@calcom/features": "*"
"@calcom/lib": "*"
checksum: 9f44ba9e258a94c9b8bb5388c400696f6e6acd20dbf73865d62739b1aad212626bb181d88b38b30d08659c8b9183d27aba94bdd52b36e6c6c3cc7594d1af29d7
checksum: 09cb5db584698acccd4447b4007df2fe2d66352c6ba823ef8c354fd3458e59414a9502f6950438e1260df71613b95f1e5a14bb54e2c7ffe6cc1dafe8b643fb9d
languageName: node
linkType: hard
@@ -5715,7 +5717,7 @@ __metadata:
languageName: node
linkType: hard
"@eslint-community/regexpp@npm:^4.10.0":
"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.5.1":
version: 4.12.1
resolution: "@eslint-community/regexpp@npm:4.12.1"
checksum: 0d628680e204bc316d545b4993d3658427ca404ae646ce541fcc65306b8c712c340e5e573e30fb9f85f4855c0c5f6dca9868931f2fcced06417fbe1a0c6cd2d6
@@ -17629,6 +17631,13 @@ __metadata:
languageName: node
linkType: hard
"@types/json-schema@npm:^7.0.12":
version: 7.0.15
resolution: "@types/json-schema@npm:7.0.15"
checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98
languageName: node
linkType: hard
"@types/json5@npm:^0.0.29":
version: 0.0.29
resolution: "@types/json5@npm:0.0.29"
@@ -18156,6 +18165,13 @@ __metadata:
languageName: node
linkType: hard
"@types/semver@npm:^7.5.0":
version: 7.7.0
resolution: "@types/semver@npm:7.7.0"
checksum: d488eaeddb23879a0a8a759bed667e1a76cb0dd4d23e3255538e24c189db387357953ca9e7a3bda2bb7f95e84cac8fe0db4fbe6b3456e893043337732d1d23cc
languageName: node
linkType: hard
"@types/send@npm:*":
version: 0.17.4
resolution: "@types/send@npm:0.17.4"
@@ -18462,21 +18478,28 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:^5.4.2 || ^6.0.0":
"@typescript-eslint/eslint-plugin@npm:^6":
version: 6.21.0
resolution: "@typescript-eslint/parser@npm:6.21.0"
resolution: "@typescript-eslint/eslint-plugin@npm:6.21.0"
dependencies:
"@eslint-community/regexpp": ^4.5.1
"@typescript-eslint/scope-manager": 6.21.0
"@typescript-eslint/types": 6.21.0
"@typescript-eslint/typescript-estree": 6.21.0
"@typescript-eslint/type-utils": 6.21.0
"@typescript-eslint/utils": 6.21.0
"@typescript-eslint/visitor-keys": 6.21.0
debug: ^4.3.4
graphemer: ^1.4.0
ignore: ^5.2.4
natural-compare: ^1.4.0
semver: ^7.5.4
ts-api-utils: ^1.0.1
peerDependencies:
"@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 162fe3a867eeeffda7328bce32dae45b52283c68c8cb23258fb9f44971f761991af61f71b8c9fe1aa389e93dfe6386f8509c1273d870736c507d76dd40647b68
checksum: 5ef2c502255e643e98051e87eb682c2a257e87afd8ec3b9f6274277615e1c2caf3131b352244cfb1987b8b2c415645eeacb9113fa841fc4c9b2ac46e8aed6efd
languageName: node
linkType: hard
@@ -18496,6 +18519,24 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:^5.4.2 || ^6.0.0, @typescript-eslint/parser@npm:^6":
version: 6.21.0
resolution: "@typescript-eslint/parser@npm:6.21.0"
dependencies:
"@typescript-eslint/scope-manager": 6.21.0
"@typescript-eslint/types": 6.21.0
"@typescript-eslint/typescript-estree": 6.21.0
"@typescript-eslint/visitor-keys": 6.21.0
debug: ^4.3.4
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 162fe3a867eeeffda7328bce32dae45b52283c68c8cb23258fb9f44971f761991af61f71b8c9fe1aa389e93dfe6386f8509c1273d870736c507d76dd40647b68
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:^5.52.0":
version: 5.52.0
resolution: "@typescript-eslint/parser@npm:5.52.0"
@@ -18560,6 +18601,23 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/type-utils@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/type-utils@npm:6.21.0"
dependencies:
"@typescript-eslint/typescript-estree": 6.21.0
"@typescript-eslint/utils": 6.21.0
debug: ^4.3.4
ts-api-utils: ^1.0.1
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 77025473f4d80acf1fafcce99c5c283e557686a61861febeba9c9913331f8a41e930bf5cd8b7a54db502a57b6eb8ea6d155cbd4f41349ed00e3d7aeb1f477ddc
languageName: node
linkType: hard
"@typescript-eslint/type-utils@npm:8.28.0":
version: 8.28.0
resolution: "@typescript-eslint/type-utils@npm:8.28.0"
@@ -18694,6 +18752,23 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/utils@npm:6.21.0":
version: 6.21.0
resolution: "@typescript-eslint/utils@npm:6.21.0"
dependencies:
"@eslint-community/eslint-utils": ^4.4.0
"@types/json-schema": ^7.0.12
"@types/semver": ^7.5.0
"@typescript-eslint/scope-manager": 6.21.0
"@typescript-eslint/types": 6.21.0
"@typescript-eslint/typescript-estree": 6.21.0
semver: ^7.5.4
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
checksum: b129b3a4aebec8468259f4589985cb59ea808afbfdb9c54f02fad11e17d185e2bf72bb332f7c36ec3c09b31f18fc41368678b076323e6e019d06f74ee93f7bf2
languageName: node
linkType: hard
"@typescript-eslint/utils@npm:8.28.0":
version: 8.28.0
resolution: "@typescript-eslint/utils@npm:8.28.0"
@@ -29699,7 +29774,7 @@ __metadata:
languageName: node
linkType: hard
"ignore@npm:^5.3.1":
"ignore@npm:^5.2.4, ignore@npm:^5.3.1":
version: 5.3.2
resolution: "ignore@npm:5.3.2"
checksum: 2acfd32a573260ea522ea0bfeff880af426d68f6831f973129e2ba7363f422923cf53aab62f8369cbf4667c7b25b6f8a3761b34ecdb284ea18e87a5262a865be