Skip to content

feat: add organization creation workflow - #16

Closed
thinkclay wants to merge 1 commit into
mainfrom
codex/create-organization-workflow-implementation
Closed

thinkclay wants to merge 1 commit into
mainfrom
codex/create-organization-workflow-implementation

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Summary

  • add database support for richer organization profiles, role policies, and an org creation RPC
  • introduce shared hooks and UI to create organizations and surface them on the dashboard
  • wire create-organization entry points into navigation, web, and native routes while fixing select field value handling

Testing

  • yarn check:type (fails: repository has existing type errors in unrelated packages such as discover-map and ui date picker)
  • yarn workspace app check:type (fails: pre-existing errors in discover-map, NativeScreenContainer, and UI date picker)

https://chatgpt.com/codex/tasks/task_b_68d1cdd6d64c8331afb2cce316eae09a

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

{childRenderer ? childRenderer(fields) : Object.values(fields)}
</FormWrapper.Body>
)
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: SchemaForm API Change Breaks Context Access

The SchemaForm component's children render function no longer passes the context parameter. This breaks the existing API contract, which previously provided both fields and context, and may cause runtime errors for consumers relying on context.

Fix in Cursor Fix in Web

@thinkclay thinkclay closed this Sep 22, 2025
@thinkclay
thinkclay deleted the codex/create-organization-workflow-implementation branch September 22, 2025 23:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +224 to +233
v_base_slug := coalesce(
nullif(lower(trim(p_slug)), ''),
lower(regexp_replace(trim(p_name), '[^a-z0-9]+', '-', 'g'))
);

if v_base_slug is null or v_base_slug = '' then
v_base_slug := substr(md5(random()::text), 1, 8);
end if;

v_slug := v_base_slug;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Sanitize user‑supplied slugs in create_organization RPC

The server function accepts any p_slug and only lowercases it (v_base_slug := coalesce(nullif(lower(trim(p_slug)), ''), …)). Unlike the UI, there is no backend validation that the slug contains only URL‑safe characters. A client can bypass the front‑end and call the RPC with a slug like 'bad slug!', which will be stored as-is. Downstream code treats organizations.slug as a path segment (e.g. /organizations/${slug}), so invalid slugs will produce broken links and inconsistent data. The function should apply the same slugification/regex check as it does when deriving a slug from the name to keep the data model reliable.

Useful? React with 👍 / 👎.

thinkclay added a commit that referenced this pull request Aug 22, 2026
Phase 3 continued (#622). Closes §12 #14 and #16 from #539.

#14 PLACEHOLDER LEGAL COPY WAS LIVE. The clickwrap gating the hire payment
button read:

  "TODO: Replace with the final anti-circumvention clause before launch.
   Paying this fee confirms you agree to keep communication and hires
   on-platform."

Employers were ticking a box to accept text that says it is a placeholder, on
the most commercially important screen in the product.

The replacement deliberately does NOT inline a bespoke clause. Scaffald
already has versioned legal acceptance — core.legal_documents is the source of
truth and clients read required versions from /v1/prerequisites/check — so a
second, hand-written set of terms living in a component is exactly how two
conflicting versions of "the agreement" come to exist. The acknowledgement now
references the published Terms of Service and links to them, so they can be
read before accepting.

The on-platform hiring obligation itself belongs in those published Terms.
That is a drafting task for counsel, not a string in a component, and this
change does not attempt it.

#16 CHART COLOURS IGNORED THE THEME. Seven pipeline stages and six hire
sources were hardcoded hex — a Tailwind-ish palette belonging to no theme and
no token file — so the charts kept indigo/violet/amber bars on a warm stone
light theme AND on a near-black dark one, at whatever contrast they happened
to land on. They read from the token ramps now and resolve per theme (600
steps for light, 300 for dark). Stage order carries progression rather than
being seven unrelated hues, so direction is legible from colour alone.

Every raw hex in the file is gone, including two `#fff` labels sitting on
coloured bars, which are now the inverse-text token — correct in both themes
because the bar step inverts with it.

#18 NEEDS NO WORK. The mock calendar data is already behind a labelled
CALENDAR_USES_SAMPLE_DATA flag with its write paths disabled and a notice
naming exactly what is real. What remains is the OAuth calendar integration
(#563), which is a feature, not UI debt.

SMOKE HARNESS — a dark-mode pass was attempted twice and removed both times
rather than shipped, because it rendered LIGHT: Playwright's `colorScheme`
does nothing here (the app reads its own context, not prefers-color-scheme)
and seeding `scaffald-ui-theme` did not take either. A pass labelled "dark"
that renders light manufactures false confidence in the half of the palette
nobody has looked at. Left as a TODO with what was tried.

Verified: typecheck clean; lint clean; /office/applications and
/office/ats/metrics rendered via the authenticated harness.

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant