@zodic/shared 0.0.300 → 0.0.301

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.
@@ -796,4 +796,48 @@ export class ArchetypeService {
796
796
  `🎉 [Batch] Completed regenerating ${compositions.length} combinations`
797
797
  );
798
798
  }
799
+
800
+ async fetchMissingArchetypeCompositions(): Promise<Composition[]> {
801
+ const db = this.context.drizzle();
802
+ const incomplete = await this.findIncompleteCombinations();
803
+
804
+ const compositions: Composition[] = [];
805
+
806
+ for (const { combination } of incomplete) {
807
+ const [sun, ascendant, moon] = combination.split('-') as ZodiacSignSlug[];
808
+
809
+ const existing = await db
810
+ .select({
811
+ archetypeIndex: schema.archetypesData.archetypeIndex,
812
+ language: schema.archetypesData.language,
813
+ gender: schema.archetypesData.gender,
814
+ })
815
+ .from(schema.archetypesData)
816
+ .where(eq(schema.archetypesData.combination, combination))
817
+ .execute();
818
+
819
+ const indexesToGenerate: number[] = [];
820
+
821
+ for (let i = 1; i <= 3; i++) {
822
+ const hasAll =
823
+ existing.filter((e) => e.archetypeIndex === i.toString()).length === 4;
824
+ if (!hasAll) indexesToGenerate.push(i);
825
+ }
826
+
827
+ if (indexesToGenerate.length > 0) {
828
+ compositions.push({
829
+ sun,
830
+ ascendant,
831
+ moon,
832
+ indexesToGenerate,
833
+ });
834
+ }
835
+ }
836
+
837
+ console.log(
838
+ `🧩 [Fetch] Missing archetype compositions to regenerate: ${compositions.length}`
839
+ );
840
+
841
+ return compositions;
842
+ }
799
843
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.300",
3
+ "version": "0.0.301",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {