feat(import-fifa17): seed unopenedPackIds as Core entitlements

Carry unopenedPackIds through the importer: Profile model -> Report ->
ApplyPlan. GenericImportRequest now emits entitlements[] (one definition_id
per unopened pack instance, order+duplicates preserved), which Core's import
seeds as unconsumed packs rows in the same transaction. Closes the economy
import gap so a migrated profile's unopened packs become Core entitlements
(feeding purchasegroup/credits/userMassInfo). Idempotency unchanged (import
fingerprint). +1 test; 26 pass, clippy -D warnings clean.
This commit is contained in:
OpenFUT Agent
2026-08-13 19:38:04 +00:00
parent 49c5185ae3
commit 96e80ab293
4 changed files with 46 additions and 0 deletions
+16
View File
@@ -105,6 +105,15 @@ pub struct GenericImportRequest {
pub owned: Vec<GenericOwned>,
#[serde(skip_serializing_if = "Option::is_none")]
pub squad: Option<GenericSquad>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub entitlements: Vec<GenericEntitlement>,
}
/// One unconsumed entitlement to seed into Core (a source `unopenedPackIds`
/// entry). `definition_id` is the pack id as text; Core stores it verbatim.
#[derive(Debug, Serialize)]
pub struct GenericEntitlement {
pub definition_id: String,
}
/// One preserved (opaque OwnedItemId ↔ source wire id) mapping to install into
@@ -231,6 +240,13 @@ pub fn plan_apply(
},
owned,
squad,
entitlements: report
.unopened_pack_ids
.iter()
.map(|id| GenericEntitlement {
definition_id: id.to_string(),
})
.collect(),
};
Ok(ApplyPlan {