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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user