dynamic locations

This commit is contained in:
2026-11-11 14:10:01 +03:30
parent 5e3bd02243
commit 658a8a74cc
18 changed files with 454 additions and 111 deletions
@@ -20,7 +20,7 @@ import {
* through the sync helpers in fanavaran-client.config.ts.
*
* Boot behaviour: for each known client key, if no document exists, insert the
* seed profile. Existing documents are never overwritten (ops can edit Mongo).
* seed profile. Existing documents retain ops edits except known legacy defaults.
*/
@Injectable()
export class FanavaranClientConfigService implements OnModuleInit {
@@ -38,6 +38,12 @@ export class FanavaranClientConfigService implements OnModuleInit {
}
async seedMissingProfiles(): Promise<void> {
// Moallem previously inherited the shared file type 23. Correct that legacy
// default on existing deployments while preserving other configured ids.
await this.configModel.updateOne(
{ key: "moallem", "defaults.ClaimFileTypeId": 23 },
{ $set: { "defaults.ClaimFileTypeId": 17 } },
);
for (const key of FANAVARAN_CLIENT_KEYS) {
const seed = SEED_FANAVARAN_CLIENT_PROFILES[key];
const existing = await this.configModel