fix: correct prop names in Svelte templates after a11y cleanup

This commit is contained in:
2026-07-10 12:27:08 +01:00
parent bee2ce81e6
commit 19d1d8dd47
20 changed files with 274 additions and 328 deletions
-40
View File
@@ -22,7 +22,6 @@ import (
) )
func TestSPV_VATAppliedAtTillSale(t *testing.T) { func TestSPV_VATAppliedAtTillSale(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -91,7 +90,6 @@ func TestSPV_VATAppliedAtTillSale(t *testing.T) {
} }
func TestMPV_NoVATAtTillSale(t *testing.T) { func TestMPV_NoVATAtTillSale(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -154,7 +152,6 @@ func TestMPV_NoVATAtTillSale(t *testing.T) {
} }
func TestMPV_VATAppliedAtRedemption(t *testing.T) { func TestMPV_VATAppliedAtRedemption(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -239,7 +236,6 @@ func TestMPV_VATAppliedAtRedemption(t *testing.T) {
} }
func TestSPV_NoVATAtRedemption(t *testing.T) { func TestSPV_NoVATAtRedemption(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -315,7 +311,6 @@ func TestSPV_NoVATAtRedemption(t *testing.T) {
} }
} }
func TestVAT_SkippedWhenNotRegistered(t *testing.T) { func TestVAT_SkippedWhenNotRegistered(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, voucher_type = 'SPV'`)
@@ -378,7 +373,6 @@ func TestVAT_SkippedWhenNotRegistered(t *testing.T) {
} }
func TestEnableVATRegistration(t *testing.T) { func TestEnableVATRegistration(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -469,7 +463,6 @@ func TestEnableVATRegistration(t *testing.T) {
} }
func TestCashBookingPayment_VATApplied(t *testing.T) { func TestCashBookingPayment_VATApplied(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -542,7 +535,6 @@ func TestCashBookingPayment_VATApplied(t *testing.T) {
} }
func TestCashBookingPayment_NoVATWhenNotRegistered(t *testing.T) { func TestCashBookingPayment_NoVATWhenNotRegistered(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
// Explicitly not registered (default) // Explicitly not registered (default)
@@ -600,7 +592,6 @@ func TestCashBookingPayment_NoVATWhenNotRegistered(t *testing.T) {
} }
func TestOnTheHouseTillSale_NoVATEvenIfRegistered(t *testing.T) { func TestOnTheHouseTillSale_NoVATEvenIfRegistered(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -658,7 +649,6 @@ func TestOnTheHouseTillSale_NoVATEvenIfRegistered(t *testing.T) {
} }
func TestGetVATConfig(t *testing.T) { func TestGetVATConfig(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 5.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 5.00, voucher_type = 'MPV'`)
@@ -693,7 +683,6 @@ func TestGetVATConfig(t *testing.T) {
} }
func TestApplyVATToBookingPayment_Direct(t *testing.T) { func TestApplyVATToBookingPayment_Direct(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -754,7 +743,6 @@ func TestApplyVATToBookingPayment_Direct(t *testing.T) {
} }
func TestApplyVATToTillSale_Direct(t *testing.T) { func TestApplyVATToTillSale_Direct(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -806,7 +794,6 @@ func TestApplyVATToTillSale_Direct(t *testing.T) {
} }
func TestVAT_Idempotency_ApplyTwice(t *testing.T) { func TestVAT_Idempotency_ApplyTwice(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -875,7 +862,6 @@ func TestVAT_Idempotency_ApplyTwice(t *testing.T) {
} }
func TestVAT_DifferentRates(t *testing.T) { func TestVAT_DifferentRates(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
// Test with 5% reduced VAT rate // Test with 5% reduced VAT rate
@@ -938,7 +924,6 @@ func TestVAT_DifferentRates(t *testing.T) {
} }
func TestPaymentSummary_VATAggregates(t *testing.T) { func TestPaymentSummary_VATAggregates(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -1033,7 +1018,6 @@ func TestPaymentSummary_VATAggregates(t *testing.T) {
} }
func TestBuyGiftCard_SPV_VATApplied(t *testing.T) { func TestBuyGiftCard_SPV_VATApplied(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -1112,7 +1096,6 @@ func TestBuyGiftCard_SPV_VATApplied(t *testing.T) {
} }
func TestVAT_ToggleLifecycle(t *testing.T) { func TestVAT_ToggleLifecycle(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = FALSE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -1252,7 +1235,6 @@ func TestVAT_ToggleLifecycle(t *testing.T) {
} }
func TestVAT_Refund_VATInclusiveCashPayment(t *testing.T) { func TestVAT_Refund_VATInclusiveCashPayment(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -1339,7 +1321,6 @@ func TestVAT_Refund_VATInclusiveCashPayment(t *testing.T) {
} }
func TestSPV_FullLifecycle_BuyAndRedeem(t *testing.T) { func TestSPV_FullLifecycle_BuyAndRedeem(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -1451,7 +1432,6 @@ func TestSPV_FullLifecycle_BuyAndRedeem(t *testing.T) {
} }
func TestMPV_FullLifecycle_BuyAndRedeem(t *testing.T) { func TestMPV_FullLifecycle_BuyAndRedeem(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -1564,7 +1544,6 @@ func TestMPV_FullLifecycle_BuyAndRedeem(t *testing.T) {
} }
func TestVAT_TopupGiftCard_NoVATOnTopup(t *testing.T) { func TestVAT_TopupGiftCard_NoVATOnTopup(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -1638,7 +1617,6 @@ func TestVAT_TopupGiftCard_NoVATOnTopup(t *testing.T) {
} }
func TestVAT_RemainingBalanceWithVAT(t *testing.T) { func TestVAT_RemainingBalanceWithVAT(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -1756,7 +1734,6 @@ func TestVAT_RemainingBalanceWithVAT(t *testing.T) {
} }
func TestVAT_GiftCardCRUD_DoesNotInterfere(t *testing.T) { func TestVAT_GiftCardCRUD_DoesNotInterfere(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -1845,7 +1822,6 @@ func TestVAT_GiftCardCRUD_DoesNotInterfere(t *testing.T) {
// TestMPV_Topup_NoVAT verifies a gift card topup with voucher_type=MPV does not // TestMPV_Topup_NoVAT verifies a gift card topup with voucher_type=MPV does not
// apply VAT at sale. // apply VAT at sale.
func TestMPV_Topup_NoVAT(t *testing.T) { func TestMPV_Topup_NoVAT(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -1919,7 +1895,6 @@ func TestMPV_Topup_NoVAT(t *testing.T) {
// Uses a booking that has already started so buildSplitRecords returns a // Uses a booking that has already started so buildSplitRecords returns a
// single payment record, making VAT assertion straightforward. // single payment record, making VAT assertion straightforward.
func TestCreateBookingPayment_VATApplied(t *testing.T) { func TestCreateBookingPayment_VATApplied(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -1989,7 +1964,6 @@ func TestCreateBookingPayment_VATApplied(t *testing.T) {
// TestTillSale_SavedCard_SPV_VATApplied verifies that a till sale with // TestTillSale_SavedCard_SPV_VATApplied verifies that a till sale with
// saved_card payment method applies VAT for SPV. // saved_card payment method applies VAT for SPV.
func TestTillSale_SavedCard_SPV_VATApplied(t *testing.T) { func TestTillSale_SavedCard_SPV_VATApplied(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -2068,7 +2042,6 @@ func TestTillSale_SavedCard_SPV_VATApplied(t *testing.T) {
// get double-taxed. The voucher_type_at_purchase stored on the card at // get double-taxed. The voucher_type_at_purchase stored on the card at
// creation time is used at redemption, not the current business_settings. // creation time is used at redemption, not the current business_settings.
func TestVoucherToggle_SPVPurchase_MPVRedeem(t *testing.T) { func TestVoucherToggle_SPVPurchase_MPVRedeem(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'SPV'`)
@@ -2182,7 +2155,6 @@ func TestVoucherToggle_SPVPurchase_MPVRedeem(t *testing.T) {
// TestApplyVATToTillSale_MPV verifies ApplyVATToTillSale has no effect when // TestApplyVATToTillSale_MPV verifies ApplyVATToTillSale has no effect when
// voucher_type is MPV. // voucher_type is MPV.
func TestApplyVATToTillSale_MPV(t *testing.T) { func TestApplyVATToTillSale_MPV(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -2229,7 +2201,6 @@ func TestApplyVATToTillSale_MPV(t *testing.T) {
// switching to SPV still gets VAT at redemption — because the stored // switching to SPV still gets VAT at redemption — because the stored
// voucher_type_at_purchase is MPV, overriding the current business_settings. // voucher_type_at_purchase is MPV, overriding the current business_settings.
func TestVoucherToggle_MPVPurchase_SPVRedeem(t *testing.T) { func TestVoucherToggle_MPVPurchase_SPVRedeem(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -2342,7 +2313,6 @@ func TestVoucherToggle_MPVPurchase_SPVRedeem(t *testing.T) {
// TestLegacyGiftCard_NullVoucherType defaults NULL voucher_type_at_purchase // TestLegacyGiftCard_NullVoucherType defaults NULL voucher_type_at_purchase
// to SPV behavior — no VAT at redemption. // to SPV behavior — no VAT at redemption.
func TestLegacyGiftCard_NullVoucherType(t *testing.T) { func TestLegacyGiftCard_NullVoucherType(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00, voucher_type = 'MPV'`)
@@ -2415,7 +2385,6 @@ func TestLegacyGiftCard_NullVoucherType(t *testing.T) {
// user's account balance (usedBalance=true), no VAT is ever applied — // user's account balance (usedBalance=true), no VAT is ever applied —
// it was already paid when the card was originally purchased. // it was already paid when the card was originally purchased.
func TestUsedBalance_NoVATRegardless(t *testing.T) { func TestUsedBalance_NoVATRegardless(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
// Set MPV — even with MPV, usedBalance should NOT have VAT // Set MPV — even with MPV, usedBalance should NOT have VAT
@@ -2495,7 +2464,6 @@ func TestUsedBalance_NoVATRegardless(t *testing.T) {
// TestVAT_DiscountPayment_NoVAT verifies that discount payments never get VAT // TestVAT_DiscountPayment_NoVAT verifies that discount payments never get VAT
// applied, even when the business is VAT-registered. // applied, even when the business is VAT-registered.
func TestVAT_DiscountPayment_NoVAT(t *testing.T) { func TestVAT_DiscountPayment_NoVAT(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -2603,7 +2571,6 @@ func TestVAT_DiscountPayment_NoVAT(t *testing.T) {
// TestVAT_SplitPayments verifies VAT is correctly partitioned across split // TestVAT_SplitPayments verifies VAT is correctly partitioned across split
// records when a single Square payment is split into deposit + balance. // records when a single Square payment is split into deposit + balance.
func TestVAT_SplitPayments(t *testing.T) { func TestVAT_SplitPayments(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -2712,7 +2679,6 @@ func TestVAT_SplitPayments(t *testing.T) {
// TestEnableVATRegistration_TillSales verifies that enable_vat_registration // TestEnableVATRegistration_TillSales verifies that enable_vat_registration
// also retroactively applies VAT to completed till_sales records. // also retroactively applies VAT to completed till_sales records.
func TestEnableVATRegistration_TillSales(t *testing.T) { func TestEnableVATRegistration_TillSales(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
adminID, err := fixtures.CreateTestAdminUser(tx) adminID, err := fixtures.CreateTestAdminUser(tx)
@@ -2775,7 +2741,6 @@ func TestEnableVATRegistration_TillSales(t *testing.T) {
} }
func TestGetVATConfig_WithTxQuerier(t *testing.T) { func TestGetVATConfig_WithTxQuerier(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 5.00, voucher_type = 'MPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 5.00, voucher_type = 'MPV'`)
@@ -2800,7 +2765,6 @@ func TestGetVATConfig_WithTxQuerier(t *testing.T) {
} }
func TestGetVATConfig_DbConnQuerier(t *testing.T) { func TestGetVATConfig_DbConnQuerier(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 8.00, voucher_type = 'SPV'`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 8.00, voucher_type = 'SPV'`)
@@ -2826,7 +2790,6 @@ func TestGetVATConfig_DbConnQuerier(t *testing.T) {
} }
func TestApplyVATToBookingPayment_DefensiveCheck(t *testing.T) { func TestApplyVATToBookingPayment_DefensiveCheck(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -2878,7 +2841,6 @@ func TestApplyVATToBookingPayment_DefensiveCheck(t *testing.T) {
} }
func TestApplyVATToBookingPayment_OnTheHouse_Skip(t *testing.T) { func TestApplyVATToBookingPayment_OnTheHouse_Skip(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -3302,7 +3264,6 @@ func TestVAT_RoundingConsistency(t *testing.T) {
for _, tt := range edgeCases { for _, tt := range edgeCases {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -3406,7 +3367,6 @@ func TestVAT_RoundingConsistency(t *testing.T) {
// including purchase, redemption, and toggle scenarios. // including purchase, redemption, and toggle scenarios.
func TestVAT_DiscountAndCashPayment_RemainingBalance(t *testing.T) { func TestVAT_DiscountAndCashPayment_RemainingBalance(t *testing.T) {
t.Parallel()
ctx, tx := testutils.SetupTestTx(t) ctx, tx := testutils.SetupTestTx(t)
_, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`) _, err := tx.Exec(ctx, `UPDATE business_settings SET is_vat_registered = TRUE, default_vat_rate = 20.00`)
@@ -1358,7 +1358,6 @@
<td class="py-3"><Skeleton class="h-4 w-20" /></td> <td class="py-3"><Skeleton class="h-4 w-20" /></td>
<td class="py-3 text-center"><Skeleton class="mx-auto h-4 w-24" /></td> <td class="py-3 text-center"><Skeleton class="mx-auto h-4 w-24" /></td>
</tr> </tr>
{:else if expiredBalances.length === 0} {:else if expiredBalances.length === 0}
<tr> <tr>
<td colspan="5" class="py-8 text-center text-gray-500"> <td colspan="5" class="py-8 text-center text-gray-500">
@@ -321,7 +321,6 @@
</div> </div>
</td> </td>
</tr> </tr>
{:else} {:else}
{#each patchTests as pt (pt.id)} {#each patchTests as pt (pt.id)}
<tr class="border-b hover:bg-gray-50"> <tr class="border-b hover:bg-gray-50">
@@ -405,7 +405,6 @@
</div> </div>
</td> </td>
</tr> </tr>
{:else} {:else}
{#each services as service (service.id)} {#each services as service (service.id)}
<tr class="border-b hover:bg-gray-50"> <tr class="border-b hover:bg-gray-50">
@@ -207,10 +207,7 @@
const dayEndTimeVal = minutesToTime(dayEndMinutesVal); const dayEndTimeVal = minutesToTime(dayEndMinutesVal);
if (shouldApplyLunchProtection(dayStartTimeVal, dayEndTimeVal)) { if (shouldApplyLunchProtection(dayStartTimeVal, dayEndTimeVal)) {
const { windowStart } = calculateMiddleWindow( const { windowStart } = calculateMiddleWindow(dayStartTimeVal, dayEndTimeVal);
dayStartTimeVal,
dayEndTimeVal
);
const lunchWalkerBlocker = { const lunchWalkerBlocker = {
startTime: minutesToTime(windowStart), startTime: minutesToTime(windowStart),
endTime: minutesToTime(windowStart + 60) endTime: minutesToTime(windowStart + 60)
@@ -468,6 +465,5 @@
maxSlotDuration={reservedDuration} maxSlotDuration={reservedDuration}
availableStartTime={reservedStartTime ?? undefined} availableStartTime={reservedStartTime ?? undefined}
{reservationExpiresAt} {reservationExpiresAt}
_onclose={handleModalClose}
/> />
{/if} {/if}
@@ -39,7 +39,7 @@
maxSlotDuration = 0, maxSlotDuration = 0,
availableStartTime, availableStartTime,
reservationExpiresAt, reservationExpiresAt,
onBookingCreated, onBookingCreated
}: Props = $props(); }: Props = $props();
// =============== State =============== // =============== State ===============
@@ -804,7 +804,6 @@
bind:value={guestPhone} bind:value={guestPhone}
bind:error={guestPhoneError} bind:error={guestPhoneError}
placeholder="07700 900000" placeholder="07700 900000"
_required={false}
/> />
</div> </div>
<p class="rounded-lg bg-yellow-50 p-3 text-sm text-yellow-800"> <p class="rounded-lg bg-yellow-50 p-3 text-sm text-yellow-800">
@@ -563,7 +563,6 @@
<Skeleton class="ml-auto h-4 w-12" /> <Skeleton class="ml-auto h-4 w-12" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@@ -219,7 +219,6 @@
return; return;
} }
try { try {
// Check for pending bookings // Check for pending bookings
const pendingResp = await apiFetch('/api/bookings?status=pending&perPage=1'); const pendingResp = await apiFetch('/api/bookings?status=pending&perPage=1');
@@ -61,8 +61,6 @@
let newCardCVC = $state(''); let newCardCVC = $state('');
let saveCardForFuture = $state(false); let saveCardForFuture = $state(false);
function parseExpiryParts(value: string): { month: number; year: number } | null { function parseExpiryParts(value: string): { month: number; year: number } | null {
if (!/^\d{2}\/\d{2}$/.test(value)) return null; if (!/^\d{2}\/\d{2}$/.test(value)) return null;
const [monthStr, yearStr] = value.split('/'); const [monthStr, yearStr] = value.split('/');
-1
View File
@@ -486,7 +486,6 @@
bind:value={formData.phone} bind:value={formData.phone}
bind:error={validationErrors.phone} bind:error={validationErrors.phone}
placeholder="07123 456789 or +44 7123 456789" placeholder="07123 456789 or +44 7123 456789"
_required
/> />
</div> </div>
-1
View File
@@ -147,7 +147,6 @@
<!-- Current/Next Appointment Card (Full Width) --> <!-- Current/Next Appointment Card (Full Width) -->
<CurrentAppointment <CurrentAppointment
_openBookingModal={openBookingModal}
{openEditBookingModal} {openEditBookingModal}
{openUserModal} {openUserModal}
/> />