@@ -110,11 +115,8 @@ watch(useRoute(), async route => {
\ No newline at end of file
diff --git a/src/rules/LedgerRefSelect.vue b/src/rules/LedgerRefSelect.vue
deleted file mode 100644
index 918d9f9..0000000
--- a/src/rules/LedgerRefSelect.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/rules/RuleClauseInput.vue b/src/rules/RuleClauseInput.vue
deleted file mode 100644
index cfdd399..0000000
--- a/src/rules/RuleClauseInput.vue
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
- From:
-
- To:
-
-
- At:
-
-
-
diff --git a/src/rules/RuleInput.vue b/src/rules/RuleInput.vue
deleted file mode 100644
index dec8253..0000000
--- a/src/rules/RuleInput.vue
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
- setClause(index, v)" />
-
-
-
-
-
-
-
-
diff --git a/src/rules/index.ts b/src/rules/index.ts
index 060eedf..5058ecb 100644
--- a/src/rules/index.ts
+++ b/src/rules/index.ts
@@ -1,3 +1 @@
export * from "./rules";
-
-export {default as RuleInput} from './RuleInput.vue';
\ No newline at end of file
diff --git a/src/rules/rules.ts b/src/rules/rules.ts
index 05afe80..59afbc9 100644
--- a/src/rules/rules.ts
+++ b/src/rules/rules.ts
@@ -2,39 +2,13 @@ import {characterRuleBookApi, ruleBookApi} from "@/mammon";
import {
CharacterRuleBookResponse,
CreateRuleBookRequest,
- ItemExchangeRuleClauseResponseRateEnum,
RuleBookResponse,
- RuleResponse,
SetCharacterRuleBookRequest
} from "@/generated/mammon";
import {defineStore} from "pinia";
import {ref, triggerRef} from "vue";
-export const activityTypes = {
- itemBought: {key: "ITEM_BOUGHT", name: "Item Bought"},
- itemSold: {key: "ITEM_SOLD", name: "Item Sold"},
- itemAcquiredManually: {key: "ITEM_ACQUIRED_MANUALLY", name: "Item Acquired Manually"},
- itemConsumedManually: {key: "ITEM_CONSUME_MANUALLY", name: "Item Consumed Manually"},
- bountyEarned: {key: "BOUNTY_EARNED", name: "Bounty Earned"},
- // itemManufactured: {id: "ITEM_MANUFACTURED", name: "Item Manufactured"}
-} as const;
-
-export type Activity = { key: ActivityType, name: string }
-export type ActivityType = typeof activityTypes[keyof typeof activityTypes]['key'];
-export type Rules = { [key: ActivityType]: RuleResponse; };
-export type RuleBook = RuleBookResponse & { rules: Rules }
-
-export const activityTypeHasRate = (key: ActivityType): boolean => key !== activityTypes.bountyEarned.key;
-
-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: ItemExchangeRuleClauseResponseRateEnum, name: string }
+export type RuleBook = RuleBookResponse;
export const useRuleBooksStore = defineStore('rule-books', () => {
const ruleBooks = ref
([]);
@@ -59,7 +33,7 @@ export const useRuleBooksStore = defineStore('rule-books', () => {
const create = (ruleBook: CreateRuleBookRequest) => ruleBookApi.createRuleBook(ruleBook).then(response => addRuleBook(response.data));
const update = (ruleBookId: string, ruleBook: CreateRuleBookRequest) => ruleBookApi.updateRuleBook(ruleBookId, ruleBook).then(response => replaceRuleBook(response.data));
- const refresh = () => ruleBookApi.findAllRuleBooks().then(response => ruleBooks.value = response.data as RuleBook[]);
+ const refresh = () => ruleBookApi.findAllRuleBooks().then(response => ruleBooks.value = response.data);
refresh();
@@ -68,7 +42,7 @@ export const useRuleBooksStore = defineStore('rule-books', () => {
export const findCharacterRuleBookByCharacterId = (characterId: number): Promise => characterRuleBookApi.findCharacterRuleBookByCharacterId(characterId)
.then(response => response.data)
- .catch(() => ({characterId, rules: {}}));
+ .catch(() => ({characterId, ruleBookId: '', bindings: {}}));
export const setCharacterRuleBookForCharacter = (characterId: number, ruleBook: SetCharacterRuleBookRequest): Promise => characterRuleBookApi.setCharacterRuleBookForCharacter(characterId, ruleBook)
.then(response => response.data);
\ No newline at end of file