reduced scope
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 20s
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 20s
This commit is contained in:
parent
e3805fd221
commit
39ce1deae7
3 changed files with 34 additions and 30 deletions
|
|
@ -1,20 +0,0 @@
|
||||||
import pb from "@ts/api/api";
|
|
||||||
import type { ValueData } from "./ValueData";
|
|
||||||
|
|
||||||
export class CurrencyConvert {
|
|
||||||
valueData: ValueData | undefined = undefined;
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
static async RetreiveCurrencyData(): Promise<ValueData> {
|
|
||||||
const item = await pb.collection("misc").getFirstListItem(`ref="currency"`);
|
|
||||||
return ShopItem.fromJSON(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DKK: baller
|
|
||||||
// target: ISO short thing. Fx. "EUR", "USD"
|
|
||||||
// Returns: Target equilavent
|
|
||||||
static async To(dkk: number, target: string): Promise<undefined | number> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
// iso: "USD", "EUR"
|
|
||||||
// value: What it is worth compared to 1 DKK
|
|
||||||
interface DkkRelativeEqualivant {
|
|
||||||
iso: string;
|
|
||||||
value: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ValueData {
|
|
||||||
data: DkkRelativeEqualivant[];
|
|
||||||
}
|
|
||||||
|
|
@ -20,3 +20,37 @@ export function DkkToCurrency(value: number, target: CurrencyType): number {
|
||||||
return value * CurrencyType.USD;
|
return value * CurrencyType.USD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// import pb from "@ts/api/api";
|
||||||
|
// import type { ValueData } from "./ValueData";
|
||||||
|
//
|
||||||
|
// export class CurrencyConvert {
|
||||||
|
// valueData: ValueData | undefined = undefined;
|
||||||
|
//
|
||||||
|
// constructor() {}
|
||||||
|
//
|
||||||
|
// static async RetreiveCurrencyData(): Promise<ValueData> {
|
||||||
|
// const item = await pb.collection("misc").getFirstListItem(`ref="currency"`);
|
||||||
|
// return ShopItem.fromJSON(item);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // DKK: baller
|
||||||
|
// // target: ISO short thing. Fx. "EUR", "USD"
|
||||||
|
// // Returns: Target equilavent
|
||||||
|
// static async To(dkk: number, target: string): Promise<undefined | number> {
|
||||||
|
// return undefined;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//// iso: "USD", "EUR"
|
||||||
|
// value: What it is worth compared to 1 DKK
|
||||||
|
// interface DkkRelativeEqualivant {
|
||||||
|
// iso: string;
|
||||||
|
// value: number;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// export interface ValueData {
|
||||||
|
// data: DkkRelativeEqualivant[];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue