autocommit 20-05-2024-14-19

This commit is contained in:
Jasen Qin 2024-05-20 14:19:44 +10:00
parent 4985c46814
commit 8c0bbbcde4
5 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import '@testing-library/jest-dom' import '@testing-library/jest-dom'
import pl from 'nodejs-polars' import pl from 'nodejs-polars'
import { create_csv_database, add_row, print_head, delete_row_by_key, save_db } from '../app/database' import { create_csv_database, add_row, print_head, delete_row_by_key, save_db } from '../app/database'
import { create_models } from '../app/model'
describe('DATABASE', () => { describe('DATABASE', () => {
it('DATA', () => { it('DATA', () => {
@ -28,6 +29,6 @@ describe('DATABASE', () => {
}) })
it('creates pos model', () => { it('creates pos model', () => {
create_models()
}) })
}) })

View File

@ -42,7 +42,7 @@ export function create_inventory_dataframe(inventories: Inventory[]): CSVDatabas
return create_csv_database(filepath, inventories) return create_csv_database(filepath, inventories)
} }
function create_models() { export function create_models() {
const items: Item[] = [ const items: Item[] = [
{ id: '1', name: 'Item 1', price: 100 }, { id: '1', name: 'Item 1', price: 100 },
{ id: '2', name: 'Item 2', price: 200 } { id: '2', name: 'Item 2', price: 200 }

View File

@ -0,0 +1,3 @@
itemId,quantity
1,50.0
2,30.0
1 itemId quantity
2 1 50.0
3 2 30.0

View File

@ -0,0 +1,3 @@
id,name,price
1,Item 1,100.0
2,Item 2,200.0
1 id name price
2 1 Item 1 100.0
3 2 Item 2 200.0

View File

@ -0,0 +1,3 @@
id,itemId,quantity,timestamp
1,1,2.0,2024-05-20T04:18:40.595Z
2,2,1.0,2024-05-20T04:18:40.595Z
1 id itemId quantity timestamp
2 1 1 2.0 2024-05-20T04:18:40.595Z
3 2 2 1.0 2024-05-20T04:18:40.595Z