This commit is contained in:
seb
2026-10-18 20:29:51 +02:00
parent f6b0ff7483
commit 8cc7d0eb0b
15 changed files with 166 additions and 24 deletions

View File

@@ -21,6 +21,15 @@ async function testProvider(name, provider) {
});
await store.google_auth.setSelectedCompany(googleAuthId, company.id);
const supplier = await store.supplier.create(googleAuthId, {
name: 'Test Supplier',
});
const groups = await store.customergroup.list(googleAuthId);
const customer = await store.entity.create(googleAuthId, {
name: 'Test Customer',
customergroupId: groups[0].id,
});
// 2. Test delivery with both dates
console.log('Testing delivery creation with date and createdAt...');
const deliveryDate = '2026-10-15T12:00:00.000Z';
@@ -28,6 +37,7 @@ async function testProvider(name, provider) {
const createdDelivery = await store.delivery.create(googleAuthId, {
externalNumber: 'DEL-2DATES-1',
supplierId: supplier.id,
date: deliveryDate,
createdAt: customCreatedAt,
lines: [
@@ -98,6 +108,7 @@ async function testProvider(name, provider) {
const order = await store.order.create(googleAuthId, {
number: `ORD-${Date.now()}`,
date: '2026-12-15T00:00:00.000Z',
entityId: customer.id,
lines: [{ name: 'Order item', amount: 3, net: 25, taxrate: 19 }],
});
assert(order.createdAt, 'Order should have default createdAt populated');