feat(import): accolades #1750
@ -94,7 +94,8 @@ import {
|
||||
ICrewMemberClient,
|
||||
ISortieRewardAttenuation,
|
||||
IInvasionProgressDatabase,
|
||||
IInvasionProgressClient
|
||||
IInvasionProgressClient,
|
||||
IAccolades
|
||||
} from "../../types/inventoryTypes/inventoryTypes";
|
||||
import { IOid } from "../../types/commonTypes";
|
||||
import {
|
||||
@ -1059,6 +1060,13 @@ pendingRecipeSchema.set("toJSON", {
|
||||
}
|
||||
});
|
||||
|
||||
const accoladesSchema = new Schema<IAccolades>(
|
||||
{
|
||||
Heirloom: Boolean
|
||||
},
|
||||
{ _id: false }
|
||||
);
|
||||
|
||||
const infestedFoundrySchema = new Schema<IInfestedFoundryDatabase>(
|
||||
{
|
||||
Name: String,
|
||||
@ -1466,6 +1474,16 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
||||
//Mastery Rank next availability
|
||||
TrainingDate: { type: Date, default: new Date(0) },
|
||||
|
||||
//Accolades
|
||||
Staff: Boolean,
|
||||
Founder: Number,
|
||||
Guide: Number,
|
||||
Moderator: Boolean,
|
||||
Partner: Boolean,
|
||||
Accolades: accoladesSchema,
|
||||
//Not an accolade but unlocks an extra chat
|
||||
Counselor: Boolean,
|
||||
|
||||
//you saw last played Region when you opened the star map
|
||||
LastRegionPlayed: String,
|
||||
|
||||
|
@ -230,17 +230,23 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
|
||||
replaceSlots(db[key], client[key]);
|
||||
}
|
||||
}
|
||||
// boolean
|
||||
for (const key of [
|
||||
"UseAdultOperatorLoadout",
|
||||
"HasOwnedVoidProjectionsPreviously",
|
||||
"ReceivedStartingGear",
|
||||
"ArchwingEnabled",
|
||||
"PlayedParkourTutorial"
|
||||
"PlayedParkourTutorial",
|
||||
"Staff",
|
||||
"Moderator",
|
||||
"Partner",
|
||||
"Counselor"
|
||||
] as const) {
|
||||
if (client[key] !== undefined) {
|
||||
db[key] = client[key];
|
||||
}
|
||||
}
|
||||
// number
|
||||
for (const key of [
|
||||
"PlayerLevel",
|
||||
"RegularCredits",
|
||||
@ -250,12 +256,15 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
|
||||
"PrimeTokens",
|
||||
"TradesRemaining",
|
||||
"GiftsRemaining",
|
||||
"ChallengesFixVersion"
|
||||
"ChallengesFixVersion",
|
||||
"Founder",
|
||||
"Guide"
|
||||
] as const) {
|
||||
if (client[key] !== undefined) {
|
||||
db[key] = client[key];
|
||||
}
|
||||
}
|
||||
// string
|
||||
for (const key of [
|
||||
"ThemeStyle",
|
||||
"ThemeBackground",
|
||||
@ -270,6 +279,7 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
|
||||
db[key] = client[key];
|
||||
}
|
||||
}
|
||||
// string[]
|
||||
for (const key of [
|
||||
"EquippedGear",
|
||||
"EquippedEmotes",
|
||||
@ -380,6 +390,9 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
|
||||
});
|
||||
});
|
||||
}
|
||||
if (client.Accolades !== undefined) {
|
||||
db.Accolades = client.Accolades;
|
||||
}
|
||||
};
|
||||
|
||||
const convertLoadOutConfig = (client: ILoadoutConfigClient): ILoadoutConfigDatabase => {
|
||||
|
@ -250,9 +250,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
|
||||
Guide?: number;
|
||||
Moderator?: boolean;
|
||||
Partner?: boolean;
|
||||
Accolades?: {
|
||||
Heirloom?: boolean;
|
||||
};
|
||||
Accolades?: IAccolades;
|
||||
Counselor?: boolean;
|
||||
Upgrades: IUpgradeClient[];
|
||||
EquippedGear: string[];
|
||||
@ -914,6 +912,10 @@ export interface IPendingRecipeClient
|
||||
CompletionDate: IMongoDate;
|
||||
}
|
||||
|
||||
export interface IAccolades {
|
||||
Heirloom?: boolean;
|
||||
}
|
||||
|
||||
export interface IPendingTrade {
|
||||
State: number;
|
||||
SelfReady: boolean;
|
||||
|
Loading…
x
Reference in New Issue
Block a user