Compare commits

..
2 Commits
Author SHA1 Message Date
Brandon Li dece6999f0 Quick resolve account types 2026-09-03 13:13:32 -05:00
Brandon Li 9d4e7a36a7 Duplicate automations 2026-09-03 13:13:03 -05:00
3 changed files with 32 additions and 1 deletions
+18
View File
@@ -163,6 +163,24 @@ export function resolveFirmAssignments(
break;
}
}
// Fallback while the throttled report fetch hasn't produced fund
// transactions yet: an account that has never traded still sits at
// exactly its opening balance, and balances arrive with the first
// sync. Only a cent-exact match counts — a traded account's balance
// won't equal any type size, so it falls through and waits for the
// reports as before. The matched size is persisted below, so the
// assignment survives once the balance starts moving.
if (!matched.type) {
const balance = client.accountCashBalances[account.id]?.amount;
if (typeof balance === 'number') {
const attempt = matchAccountType(account.name, balance, types);
if (attempt.type) {
matched = attempt;
matchedSize = balance;
}
}
}
}
if (matched.type) {
+14 -1
View File
@@ -298,8 +298,21 @@ export const FIRMS: Firm[] = [
// makes the two clicks self-sequence — the first tick checks
// box one, so the second click resolves to box two — and
// re-clicking never un-ticks a box already checked.
//
// WooCommerce only stamps validate-required on its own
// required rows; the second agreement box here is theme
// markup without that class, so the second click also
// sweeps the whole checkout form for unchecked boxes —
// minus the ones that must never be ticked (different
// shipping address expands extra fields, mailing-list
// opt-ins). No skipIfNotFound: silently skipping the
// second agreement just moves the failure to the
// modal-close gate below with a misleading timeout.
{ action: 'click', selector: '.validate-required input[type="checkbox"]:not(:checked)', frame: '#woocommerceModal iframe', label: 'Agree to terms' },
{ action: 'click', selector: '.validate-required input[type="checkbox"]:not(:checked)', frame: '#woocommerceModal iframe', skipIfNotFound: true, label: 'Agree to terms 2' },
// Ticking box one can re-render the checkout (update_checkout);
// give it a beat so the second locate sees the settled DOM.
{ action: 'wait', seconds: 1 },
{ action: 'click', selector: '.validate-required input[type="checkbox"]:not(:checked), form.checkout input[type="checkbox"]:not(:checked):not(#ship-to-different-address-checkbox):not([name*="subscribe"]):not([name*="newsletter"]):not([id*="newsletter"]):not([id*="mailchimp"]):not([id*="mc4wp"])', frame: '#woocommerceModal iframe', label: 'Agree to terms 2' },
{ action: 'waitFor', selector: '#woocommerceModal', absent: true, hidden: true, timeoutSeconds: 30, label: 'Wait for the modal to close' },
BIN
View File
Binary file not shown.