feat: add multi-city representation support and domain context resolution

- Created migration to add representation_cities table and domain, is_global fields to representations.
- Implemented SiteContextController to resolve domain to site context (city | representation | unknown).
- Developed DomainContext and DomainContextResolver services for domain mapping.
- Added tests for DomainContextResolver and commission logic based on domain ownership.
This commit is contained in:
hamed
2026-07-09 07:26:58 +03:30
parent 59559e2e31
commit 0750bc9812
56 changed files with 4297 additions and 1600 deletions
+74 -44
View File
@@ -330,8 +330,8 @@
"semantic_hash": ""
},
"assets/admin/pages/RepresentationsPage.tsx": {
"mtime": 1781869996.049502,
"ast_hash": "209d7dbe4157ebe69748d71acc2aa853",
"mtime": 1783569345.7762475,
"ast_hash": "55e5abec0221125a26d09949eb7e3f20",
"semantic_hash": ""
},
"assets/admin/pages/SecretariesPage.tsx": {
@@ -400,8 +400,8 @@
"semantic_hash": ""
},
"assets/admin/types/index.ts": {
"mtime": 1783499946.4879165,
"ast_hash": "edd28014dfe716c5bdaf1743e17bfea4",
"mtime": 1783569345.7764525,
"ast_hash": "caee3b2fd870a2e6f75ee6fb889ec0b1",
"semantic_hash": ""
},
"assets/app.js": {
@@ -810,8 +810,8 @@
"semantic_hash": ""
},
"src/Admin/Controller/AdminApiController.php": {
"mtime": 1783455997.6031876,
"ast_hash": "b17487b206b1483b616160fabb15f429",
"mtime": 1783569345.7785833,
"ast_hash": "76990cb279d535ab2d869f87752a185a",
"semantic_hash": ""
},
"src/Admin/Controller/AdminController.php": {
@@ -825,8 +825,8 @@
"semantic_hash": ""
},
"src/Appointment/Controller/AppointmentController.php": {
"mtime": 1782304270.2436676,
"ast_hash": "4af2f29806e8974c8f8b33af69a3b0a0",
"mtime": 1783569345.7788084,
"ast_hash": "f0cef49f9e7857799c71ea434525dbef",
"semantic_hash": ""
},
"src/Appointment/Controller/AppointmentSettingsController.php": {
@@ -1075,8 +1075,8 @@
"semantic_hash": ""
},
"src/Clinic/Controller/ClinicController.php": {
"mtime": 1782035216.5144877,
"ast_hash": "6a25be705a1b2c5e1ea41878a25009fb",
"mtime": 1783569345.779344,
"ast_hash": "4a12996b6afa6abb733c8f3f4da1c891",
"semantic_hash": ""
},
"src/Clinic/Entity/Clinic.php": {
@@ -1085,8 +1085,8 @@
"semantic_hash": ""
},
"src/Clinic/Repository/ClinicRepository.php": {
"mtime": 1781782025.3981936,
"ast_hash": "d3cd179c5e663867a2db6e465eb0cd73",
"mtime": 1783569345.779688,
"ast_hash": "7bce0f0c753de7786d7e5d6c5068724e",
"semantic_hash": ""
},
"src/ClinicInvitation/Controller/ClinicInvitationController.php": {
@@ -1180,8 +1180,8 @@
"semantic_hash": ""
},
"src/Doctor/Controller/DoctorController.php": {
"mtime": 1782978998.6554778,
"ast_hash": "86fbb75fbf607a364e8b98bcf921076a",
"mtime": 1783569345.7800236,
"ast_hash": "c056cab3f38fa4a224564ac3a2d4b728",
"semantic_hash": ""
},
"src/Doctor/Entity/Doctor.php": {
@@ -1200,8 +1200,8 @@
"semantic_hash": ""
},
"src/Doctor/Repository/DoctorRepository.php": {
"mtime": 1782977943.3100293,
"ast_hash": "8107334c65e7a5db72bfe6f94875b463",
"mtime": 1783569345.7805371,
"ast_hash": "90a5e3ccc3f1997cd50b5a2cb67d37e2",
"semantic_hash": ""
},
"src/DoctorService/Controller/DoctorServiceController.php": {
@@ -1310,8 +1310,8 @@
"semantic_hash": ""
},
"src/Location/Repository/CityRepository.php": {
"mtime": 1781085493.5616481,
"ast_hash": "bb4f54064d492b4d00aa0a8a21c7cb02",
"mtime": 1783569345.7806973,
"ast_hash": "72c4e4ad42c3709b056a0f248564504b",
"semantic_hash": ""
},
"src/Location/Repository/ProvinceRepository.php": {
@@ -1450,18 +1450,18 @@
"semantic_hash": ""
},
"src/Representation/Controller/RepresentationController.php": {
"mtime": 1782728407.2007582,
"ast_hash": "321713adc028713c1ead67a8ac9fbc09",
"mtime": 1783569345.781025,
"ast_hash": "669db8838feadee4a2515ddb46512d97",
"semantic_hash": ""
},
"src/Representation/Entity/Representation.php": {
"mtime": 1782650883.6145928,
"ast_hash": "b40403a32c980865f30ab428cd2f83ca",
"mtime": 1783569345.7812188,
"ast_hash": "a131cbff7a6d64e29c5f3ab61b470948",
"semantic_hash": ""
},
"src/Representation/Repository/RepresentationRepository.php": {
"mtime": 1782304285.8684978,
"ast_hash": "9a8035b3d8f18a47625f09e7665b3ecb",
"mtime": 1783569345.78135,
"ast_hash": "790e3fa6a3be7229e118cbc5e0cd9320",
"semantic_hash": ""
},
"src/Representation/Service/JalaliDateService.php": {
@@ -1530,8 +1530,8 @@
"semantic_hash": ""
},
"src/Settlement/Service/CommissionService.php": {
"mtime": 1782304402.8866458,
"ast_hash": "0257455b074592fb441b733cacced591",
"mtime": 1783569345.781548,
"ast_hash": "c442f7ef0e0ab80172f8cdeb8cc09593",
"semantic_hash": ""
},
"src/Shared/Constant/ErrorCodes.php": {
@@ -2260,8 +2260,8 @@
"semantic_hash": ""
},
"config/packages/security.yaml": {
"mtime": 1782995001.0929694,
"ast_hash": "3b126684770e87f7fef6545e099751fa",
"mtime": 1783569345.7766566,
"ast_hash": "6d04ed4f39e92b722ac727559194623a",
"semantic_hash": ""
},
"config/packages/twig.yaml": {
@@ -2340,8 +2340,8 @@
"semantic_hash": ""
},
"docs/api/admin.md": {
"mtime": 1783456077.2420146,
"ast_hash": "696cb26081d025472722594dfdc32152",
"mtime": 1783569345.7769597,
"ast_hash": "c0e70f627d969f3449dbe58fe653a9bf",
"semantic_hash": ""
},
"docs/api/appointment-settings.md": {
@@ -2380,8 +2380,8 @@
"semantic_hash": ""
},
"docs/api/clinic.md": {
"mtime": 1782035382.8888016,
"ast_hash": "24d7edcb8e5218250a6f7653e43c5d4f",
"mtime": 1783569345.777287,
"ast_hash": "c7b11dfac717f33e2b39372bb6d64c88",
"semantic_hash": ""
},
"docs/api/dashboard.md": {
@@ -2395,8 +2395,8 @@
"semantic_hash": ""
},
"docs/api/doctor.md": {
"mtime": 1782979047.5438921,
"ast_hash": "7f95fa1394ef1d84899929b5f2cf4d64",
"mtime": 1783569345.7776468,
"ast_hash": "70d56cf0705dfbfa35d4ea282536acfe",
"semantic_hash": ""
},
"docs/api/insurance.md": {
@@ -2415,8 +2415,8 @@
"semantic_hash": ""
},
"docs/api/payment.md": {
"mtime": 1783059802.8154833,
"ast_hash": "324965b58abe6317caab5653c982dfa7",
"mtime": 1783569345.7778866,
"ast_hash": "7e3149d1eb32cfdd150b44f29598e402",
"semantic_hash": ""
},
"docs/api/rating.md": {
@@ -2425,8 +2425,8 @@
"semantic_hash": ""
},
"docs/api/representation.md": {
"mtime": 1782979067.5559928,
"ast_hash": "0766b25592e2868c3e87d4e38958fa2e",
"mtime": 1783569345.77808,
"ast_hash": "2c4bbddefd4346abb457d327f2d8e6ae",
"semantic_hash": ""
},
"docs/api/secretary.md": {
@@ -3540,8 +3540,8 @@
"semantic_hash": ""
},
"src/Payment/Service/PaymentManager.php": {
"mtime": 1783239408.129024,
"ast_hash": "51937725073adf1f98391b485befaa79",
"mtime": 1783569345.7808533,
"ast_hash": "598f5727567765180a0fb1a9a7e60637",
"semantic_hash": ""
},
"tests/Payment/MellatGatewayTest.php": {
@@ -3745,8 +3745,8 @@
"semantic_hash": ""
},
"docs/ops-restarts.md": {
"mtime": 1783520952.2040253,
"ast_hash": "dd4692cc3fd108adf9cc15cb56999427",
"mtime": 1783528554.1951141,
"ast_hash": "6594570089394fd7591c73d421bf426d",
"semantic_hash": ""
},
"migrations/Version20260708083446.php": {
@@ -3755,13 +3755,43 @@
"semantic_hash": ""
},
"docs/collect-diagnostics.sh": {
"mtime": 1783520903.6040976,
"ast_hash": "5f2a05a7c797b9d61d22052335d2836b",
"mtime": 1783528559.0945294,
"ast_hash": "e4d454d67401331938ae2b169bf83cba",
"semantic_hash": ""
},
".claude/prompt/server-down-oom-diagnosis.md": {
"mtime": 1783520770.2451262,
"ast_hash": "6cc51cccf53e21a9a25fc6208b0357dd",
"semantic_hash": ""
},
"migrations/Version20260709033925.php": {
"mtime": 1783569345.8005955,
"ast_hash": "801ed6f414d3ced74f63528d71de2560",
"semantic_hash": ""
},
"src/Representation/Controller/SiteContextController.php": {
"mtime": 1783569345.8007598,
"ast_hash": "0414946458022dbf078687189c80d14d",
"semantic_hash": ""
},
"src/Representation/Service/DomainContext.php": {
"mtime": 1783569345.8009496,
"ast_hash": "e7c7530c013778f3078db9c445e0d8c3",
"semantic_hash": ""
},
"src/Representation/Service/DomainContextResolver.php": {
"mtime": 1783569345.8010752,
"ast_hash": "85a774dafdbdc6e9a9c619943e8cf06c",
"semantic_hash": ""
},
"tests/Representation/DomainCommissionTest.php": {
"mtime": 1783569345.8012395,
"ast_hash": "d5a6e6c27e5cde29618dc797b86589f9",
"semantic_hash": ""
},
".claude/prompt/representation-multi-city-domain-commission.md": {
"mtime": 1783569345.800353,
"ast_hash": "7405ad1b5e6eb371ea5955ffb70195bc",
"semantic_hash": ""
}
}