pretyness
This commit is contained in:
+17
-6
@@ -1,16 +1,27 @@
|
||||
import {ruleBookControllerApi} from "@/mammon";
|
||||
import {RuleBookResponse, RuleSetResponse} from "@/generated/mammon";
|
||||
import {RuleBookResponse, RuleResponseRateEnum, RuleSetResponse} from "@/generated/mammon";
|
||||
|
||||
export const activityTypes = {
|
||||
itemBought: "ITEM_BOUGHT",
|
||||
itemSold: "ITEM_SOLD",
|
||||
// bountyEarned: "BOUNTY_EARNED",
|
||||
// itemManufactured: "ITEM_MANUFACTURED"
|
||||
itemBought: {key: "ITEM_BOUGHT", name: "Item Bought"},
|
||||
itemSold: {key: "ITEM_SOLD", name: "Item Sold"},
|
||||
// bountyEarned: {id: "BOUNTY_EARNED", name: "Bounty Earned"},
|
||||
// itemManufactured: {id: "ITEM_MANUFACTURED", name: "Item Manufactured"}
|
||||
} as const;
|
||||
|
||||
export type ActivityType = typeof activityTypes[keyof typeof activityTypes];
|
||||
export type Activity = { key: ActivityType, name: string }
|
||||
export type ActivityType = typeof activityTypes[keyof typeof activityTypes]['key'];
|
||||
export type RuleBook = RuleBookResponse & { ruleSets: { [key: ActivityType]: RuleSetResponse; } }
|
||||
|
||||
export const ratesTypes = {
|
||||
None: {key: "NONE", name: "0 ISK"},
|
||||
Value: {key: "VALUE", name: "Value"},
|
||||
JitaBuy: {key: "JITA_BUY", name: "Jita Buy Order"},
|
||||
JitaSell: {key: "JITA_SELL", name: "Jita Sell Order"},
|
||||
EveEstimate: {key: "EVE_ESTIMATE", name: "Eve Estimate"},
|
||||
} as const;
|
||||
|
||||
export type Rate = { key: RuleResponseRateEnum, name: string }
|
||||
|
||||
export const findByCharacterId = (characterId: number): Promise<RuleBook> => ruleBookControllerApi.findByCharacterId(characterId)
|
||||
.then(response => response.data)
|
||||
.catch(() => ({characterId, ruleSets: {}}));
|
||||
|
||||
Reference in New Issue
Block a user