--!strict --[[ ProfileTemplate.luau The canonical shape of a player's saved data. ProfileStore fills any missing keys from this template automatically (safe forward-migration: add a key here and existing players get the default on next load). NEVER remove/rename a key without a migration plan — that's how saves break. ]] local GameConfig = require(script.Parent.GameConfig) export type UpgradeLevels = { Engine: number, Tires: number, Nitro: number, } export type OwnedCar = { Id: string, Upgrades: UpgradeLevels, } export type ProfileData = { Cash: number, Rep: number, OwnedCars: { OwnedCar }, EquippedCarId: string, LastDailyClaim: number, -- os.time() of last claim; 0 = never TotalRaces: number, Wins: number, Version: number, -- schema version for future migrations } local ProfileTemplate: ProfileData = { Cash = GameConfig.StartingCash, Rep = GameConfig.StartingRep, OwnedCars = { { Id = GameConfig.StartingCarId, Upgrades = { Engine = 0, Tires = 0, Nitro = 0 }, }, }, EquippedCarId = GameConfig.StartingCarId, LastDailyClaim = 0, TotalRaces = 0, Wins = 0, Version = 1, } return ProfileTemplate