-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98d7801
commit 6f190c9
Showing
18 changed files
with
5,439 additions
and
53,580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import Dexie, { type EntityTable } from 'dexie'; | ||
import { liveQuery } from 'dexie'; | ||
import type { Quote, Rate, Usage } from '$lib/interfaces/index'; | ||
import type { Computation, Quote, Rate, Usage } from '$lib/interfaces/index'; | ||
|
||
const db = new Dexie('spm') as Dexie & { | ||
rates: EntityTable<Rate, 'id'>; | ||
quotes: EntityTable<Quote, 'id'>; | ||
usage: EntityTable<Usage, 'Product Part'>; | ||
computation: EntityTable<Computation, 'SKU'>; | ||
}; | ||
|
||
db.version(1).stores({ rates: 'id', quotes: 'id', usage: '++id' }); | ||
db.version(1).stores({ | ||
rates: 'id', | ||
quotes: 'id', | ||
usage: '++id', | ||
computation: '++id,SKU' | ||
}); | ||
|
||
const ratecard = liveQuery(() => db.rates.toArray()); | ||
const usage = liveQuery(() => db.usage.toArray()); | ||
const quotes = liveQuery(() => db.quotes.toArray()); | ||
const computation = liveQuery(() => db.computation.toArray()); | ||
|
||
export { db, quotes, ratecard, usage }; | ||
export { computation, db, quotes, ratecard, usage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
export type ComputationSourceColumns = | ||
| 'Subscription Plan Number' | ||
| 'Subscription Id' | ||
| 'SKU/Product' | ||
| 'UOM' | ||
| 'Usage Quantity' | ||
| 'Compute Type' | ||
| 'Metered Service Date' | ||
| 'Currency' | ||
| 'Computed Amount' | ||
| 'Computed Amount CD' | ||
| 'Overage' | ||
| 'Data Center' | ||
| 'Unit Rate Card'; | ||
|
||
export interface Computation { | ||
'Computed Quantity': number; | ||
'Line Net Amount Increased Precision': number; | ||
'Metered service date': Date; | ||
'Net Unit Price': number; | ||
'Product Name': string; | ||
'Product Part': string; | ||
'Subscription Plan Number': string; | ||
'Subscription Id': string; | ||
SKU: string; | ||
Product: string; | ||
UOM: string; | ||
'Usage Quantity': number; | ||
'Compute Type': string; | ||
'Metered Service Date': Date; | ||
Currency: string; | ||
'Computed Amount': number; | ||
'Computed Amount CD': number; | ||
Overage: boolean; | ||
'Data Center': string; | ||
'Unit Rate Card': number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export type { Computation } from './Computation'; | ||
export type { Rate } from './Rate'; | ||
export type { Usage } from './Usage'; | ||
export type { Computation, ComputationSourceColumns } from './Computation'; | ||
export type { Rate, RateSourceColumns } from './Rate'; | ||
export type { Usage, UsageSourceColumns } from './Usage'; | ||
export type { Line, Quote } from './Quote'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { parseComputation, parseSampleComputation } from './computation'; | ||
export { parseRatecard, parseSampleRatecard } from './ratecard'; | ||
export { parseUsage, parseSampleUsage } from './usage'; | ||
export { parseComputation } from './computation'; | ||
export { parseRatecard } from './ratecard'; | ||
export { parseUsage } from './usage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.