initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

27
resources/js/db.js Normal file
View File

@@ -0,0 +1,27 @@
import Dexie from 'dexie';
export const db = new Dexie('BukidBountyPOS');
db.version(1).stores({
// products: hashkey(primary), name, category, barcode, price, available
products: 'hashkey, name, category, barcode, price',
// customers: hashkey(primary), name, phone
customers: 'hashkey, name, phone',
// pending_transactions: id(auto increment), store_hash, customer_name, items(JSON), total, received, change, timestamp, status
pending_transactions: '++id, store_hash, customer_name, timestamp, status',
// settings: key(primary), value
settings: 'key'
});
// Helper to save basic settings
export async function setOfflineSetting(key, value) {
return await db.settings.put({ key, value });
}
export async function getOfflineSetting(key) {
const result = await db.settings.get(key);
return result ? result.value : null;
}