     init() {}
 
     func addAlias(_ alias: String,
-                  of targetName: String,
-                  for product: String,
-                  from originPackage: PackageIdentity,
-                  in parentPackage: PackageIdentity) {
-        let model = ModuleAliasModel(name: targetName, alias: alias, originPackage: originPackage, parentPackage: parentPackage)
+                  target: String,
+                  product: String,
+                  originPackage: PackageIdentity,
+                  consumingPackage: PackageIdentity) {
+        let model = ModuleAliasModel(name: target, alias: alias, originPackage: originPackage, consumingPackage: consumingPackage)
         aliasMap[originPackage, default: [:]][product, default: []].append(model)
     }
 

        }
    }

    func alias(of targetName: String,
               in originPackage: PackageIdentity) -> String? {
        if let aliasDict = aliasMap[originPackage] {
            let models = aliasDict.values.flatMap{$0}.filter { $0.name == targetName }
            // this func only checks if there's any existing alias so
            // just return the first alias value
            return models.first?.alias

    }

    // Gather and resolve module aliases specified for targets in all dependent packages
    let packageAliases = resolveModuleAliases(packageBuilders: packageBuilders,
                                              observabilityScope: observabilityScope)

    // Scan and validate the dependencies
    for packageBuilder in packageBuilders {
