TESWA — ONE PHONE, ONE ACCOUNT · THE PLAN · 2026-07-29

Separating people from companies

You decided a phone number is either a person or a company, never both. Before writing a line of code, a 12-agent sweep read the whole codebase — the site, the server functions, the phone app, the security rules and production itself — to find every place that depends on the model being replaced. This page is what it found, what it will cost, and the order it has to happen in.

739

places it touches

109

get DELETED

304

high risk

8

phases, 1 irreversible

That 109 is the good number: this change removes more machinery than it adds. The full list, with a file and a line for every row, is in the repo at plan/identity/inventory.json — that file is the contract, not this page.

What you decided

One phone number = one account. Individual or business. Never both.

IndividualBusiness
Worldsall of them — a car and a flat from one accountONE, fixed at approval, forever
Pays byباقات — priced per worldاشتراك — its own world tiers only
Can postin any worldin its own world only
Appears inits own world directory only

A person lives in both worlds. A company sells one thing.

THE MOST IMPORTANT THING HERE

The one decision that made this safe

The account STAYS exactly where it lives today — users/{uid}/accounts/{type} — and keeps the same id. The new rule is enforced as «a second account document may never be created», NOT as «rebuild the database». Everything follows from that.

  • No public link breaks. /showroom, /seller and /office are keyed on the sign-in id, and both personas already share ONE id — so nothing Google indexed and nothing sent on WhatsApp changes.
  • No redirect layer is needed at all — the whole thing the sweep was worried about disappears.
  • The old phone app keeps working. It reads that exact path, and it can never be force-updated.
  • Three background jobs that silently resolve a user from that path (the saved-search digest, the price-drop and the sold-favourite alerts) keep working untouched.

YOU SHOULD KNOW THIS BEFORE WE START

The one trap still ahead

B3Deleting the switch OPENS a money gate instead of closing it

The refusal that stops a business buying an individual package works by reading the very field phase 3 removes — and if that field is simply gone, the check does not refuse, it ALLOWS. Two more money doors have no account check at all and can be called straight over the internet without the site. All three are repointed at the start of phase 3, before anything is deleted, and the gate proves each one still refuses.

AND THESE WERE BLOCKING — THEY ARE NOT ANY MORE

  • «One phone = one account» had no data underneath it — most accounts carried no phone number, five approved showrooms had nobody behind them, eight businesses had no world. FIXED in phase 1; the gate proves it, 9 checks out of 9.
  • Your own account was the whole migration — the only subscription, and a personal side on the same number. RESOLVED by deleting one side of each, on your call that this is test data. There is nothing left to migrate.
  • The old phone app would rebuild what we removed, and could never be updated. GONE — Teswa is a website. That removed 117 items from the list and, more importantly, thirty rules I had written as «we must keep this because the app reads it». They were never real limits.

THE PLAN CHANGED — HERE IS WHY

Why this plan is now 12 phases, not 8

I rated the first version 7 out of 10 and told you the phase coverage was unverified. So it got verified: three independent readers checked every row against the phases, and their whole job was to find what I had missed. They each found the SAME thing from a different angle — the plan was missing work, and two steps were in an order that would have broken the live site.

WORK THAT WAS SIMPLY MISSING

  • Nothing built the half of YOUR decision that says an individual posts in all worlds. The old phase 4 was titled «world lock for BUSINESS money» and was business-only from top to bottom. That is now its own phase 4.
  • You answered YES to putting the account type in the login token — and no phase actually did it. Nothing stamped the existing accounts, nothing stamped a business at approval, and nothing handled the fact that a signed-in person keeps their old token for 14 days. That is now phase 8, and until it passes no rule may rely on the stamp.
  • Your DEC-1 answer retires a side of two accounts — and the plan moved the account documents while saying nothing about what that side OWNED: paid subscription time, 34 bump credits, its live ads, its public page, and the money history that cannot be reconstructed afterwards because orders do not record which side paid. That is now phase 10.
  • 138 of the rows are the phone app, and no phase owned it. Property ads leak into the car browse on every installed build today, the app's share link points at a domain that does not resolve, and after phase 2 some of its buttons will simply error. Those can only ever be fixed in a released build — phase 12.

ORDERING THAT WOULD HAVE BROKEN THE LIVE SITE

  • The rules phase was going to FREEZE a business's world one phase BEFORE the phase that fills that world in. «معرض النجوم للسيارات» — your only paying subscriber — has no world stored at all, so its profile saves would have started failing the moment the rule deployed and stayed broken for two phases. The backfill moved earlier, ahead of the freeze.
  • A filter that keeps a showroom's ads off a person's public page was labelled «delete this» with a home three phases before the accounts collapse. Deleting it there would have put the showroom's 58 ads on the individual's page and the individual's cars on the showroom page — on pages Google has crawled and customers have shared — while nothing had yet decided which side survives. It now stays until the cutover.
  • Four pieces of the same money decision — the one that spends a coin and decides whether an ad appears at all — were split across two phases because four different readers each found the same line. A half-rewired version of that either lets a business bypass its cap or parks a paid ad forever with a healthy-looking log. They are now one commit.
  • Two money doors that can be called straight over the internet, without going through the site at all, had no account check whatsoever — so a plan that only deleted buttons would have left them wide open. They are now closed in the same phase as the resolver.

The eight phases

Each one ships on its own and leaves the site working. The one step that cannot be undone is LAST — everything before it is proved on throwaway accounts we create on the live site.

1

Safety net, census, disarm

Be able to put everything back, know every account that exists, clean the data the rule cannot be enforced on, and switch off the buttons that could destroy money while we work.

estimate: done

IT DOES NOT PASS UNTIL

A snapshot from today restores identical; no uid holds two accounts; every account holder has a phone; every business carries its world; the destructive actions and the seeders that would undo it are all disabled.

reading the gate result…

2

Rules — one account per phone, world frozen

Make the rule real at the database, not just in the interface: a phone can never open a second account, and a business can never change its world after approval.

estimate: 1-2 days

IT DOES NOT PASS UNTIL

On the test database a second account is REFUSED and a world change is REFUSED, while every shape a real seller writes today still passes — including a business whose world was only just filled in.

the gate is not written yet — so nothing here claims this phase passed

3

One resolver — in ONE deploy

The whole site stops asking «which of my two accounts is active» and asks «what is this account». The switcher and the add-a-second-account path are deleted. An individual posting in both worlds is finished here too.

estimate: 3-4 days

IT DOES NOT PASS UNTIL

No server code reads the old switch anywhere; three BRAND-NEW accounts on the live site — a person, a showroom, an office — each publish a real ad that lands with the right owner, the right payment channel and on the right public page; the person publishes in BOTH worlds and each world spends its own coins.

the gate is not written yet — so nothing here claims this phase passed

4

Business money locked to its world

A car showroom can only post, buy and be priced in cars. A property office only in property. No exceptions, including the doors that can be called without the site.

estimate: 1-2 days

IT DOES NOT PASS UNTIL

The car business is REFUSED a property plan and the office is refused a car plan on every money door — including the two callable straight over the internet — and the office's plan name and limits show real numbers instead of the zeros they show today.

the gate is not written yet — so nothing here claims this phase passed

5

Cleanup — the last inconsistent data

The five demo showrooms nobody can sign into, the twenty ghost account paths a nightly job keeps recreating, and the database indexes nothing needs any more.

estimate: 1 day

IT DOES NOT PASS UNTIL

Zero ghost paths after the nightly job runs, every remaining account is one a real person can sign into, and nothing on the site broke when the unused indexes were dropped.

the gate is not written yet — so nothing here claims this phase passed

Deliberately NOT in the plan

These were on the critical path in the first version. They are real work and worth doing — but the model is true without them, so holding the whole project behind them was my mistake, not a requirement.

Seller vocabulary polish56 sites

Making every seller badge, link and share button agree about showroom-vs-person. Worth doing, but the model is true without it — and the one piece that is actually BROKEN today (your «معرض» filter returning nothing) is being fixed now, on its own, not held behind this.

Admin tooling70 sites

The users list becoming one row per person, per-world revenue, the wallet desk reaching the property purse. Exactly ONE row of it is required for the model — approving a business must record its world — and that one moved into phase 3. The rest is dashboard comfort, and the dashboard has no login on production yet.

Stamping the type into the login token13 sites

You said yes to this, and it IS stronger — the security rules would enforce the account type themselves instead of trusting the browser. But I owe you the honest version I did not give before: the model works without it. Nothing in your five goals needs it. It is hardening, so it waits until the model is live.

The phone app is not on this list because it is not part of Teswa. Teswa is a website. A new app gets built later, from the site.

Six things I need from you

0 / 6

The sweep raised 77 questions. Most were the same question asked by different readers, and most were answered by the decision above. These six are the ones that actually change the work. My recommendation is marked — pick it or overrule it.

DEC-1

Your two accounts hold both types — which side survives?

+965 99255194 is a car showroom AND a person. +965 50000000 is a property office AND a person. Under the new rule each keeps ONE.

why it matters: The losing side's ads change owner type. For your showroom that is about 28 ads.

DEC-2

One coin purse for an individual, or one per world?

An individual can now post in BOTH worlds. Today there are two separate purses — car coins and property coins.

why it matters: It decides whether a free car coin can be spent on a flat.

DEC-3

Does a business keep favourites and saved searches?

Those are buyer tools. A showroom is a seller — but its staff still browse.

why it matters: It decides what happens to the buyer data sitting on the side that gets retired.

DEC-4

When the two sides merge, what happens to the buyer data on both?

Both sides hold favourites and view history. One listing is currently favourited TWICE by the same person, which inflates its public counter.

why it matters: View history hard-deletes past 50 rows on the next page view, so the merge has to trim deliberately or it silently loses the wrong ones.

DEC-5

Should the account type live in the login token?

Today the security rules cannot tell a dealer from a person — the type is in a document they cannot cheaply read. Putting it in the login token makes it enforceable and unforgeable.

why it matters: It is the difference between the rule being a convention and being a lock. We already do exactly this for admins.

DEC-6

Human-readable showroom links — now or later?

A showroom page is teswa.net/showroom/IWvheUWl6XTTO7HaaN8qca9uivJ3 today. It could be /showroom/najoom-cars.

why it matters: This plan no longer needs to touch those links at all — so doing it now is a CHOICE, not a requirement. Bundling it back in re-adds the redirect risk we just removed.

How progress is tracked — and why you will not have to chase me

  • plan/identity/inventory.json is the contract: 739 rows, every one with a file and a line. If it is not on the list it does not get built; if it is on the list it does not get quietly dropped.
  • Each phase has a GATE that is a script, not a sentence. It runs against the LIVE site and writes what it found to a file with a timestamp.
  • This page RENDERS those files. There is no status text I can type. Green means a script said green, at a time you can see.
  • Anything I choose not to do appears in «اللي ما سويته» with the reason. The silent skip that happened last time cannot happen inside this.
  • Before every push: a full build, the type check, the linter and the rules tests. Two red deploys today came from skipping the first one.
🔧🧪