feat(import): accolades (#1750)
All checks were successful
Build Docker image / docker (push) Successful in 38s
Build / build (push) Successful in 1m42s

So one is able to import e.g. `{"Staff":true}` to set that field to true without going into Compass.

Reviewed-on: #1750
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-04-20 07:53:45 -07:00 committed by Sainan
parent 8fd7152c41
commit 11f2ffe64d
3 changed files with 39 additions and 6 deletions

View File

@ -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,

View File

@ -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 => {

View File

@ -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;