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