Commit 632a4891 authored by Mahmoud Aglan's avatar Mahmoud Aglan

docs: quote the server's new wording in the redeem, org and hosting contracts

Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 097add47
......@@ -341,7 +341,7 @@ Hard limits, enforced when a code is created:
- Native app: the `el3ab://redeem/K7QM4WXP` scheme, and Android App Links for `/r/*`, which need a `/.well-known/assetlinks.json` file served by the player app. The Flutter shell isn't in either repo, so that part is an external dependency. `native-bridge.js` `handleDeepLink` gets a new `case 'redeem'`.
**Server-rendered preview in `index.php`.** When `REQUEST_URI` matches `^/r/([^/?#]{4,40})$`, look the code up read-only with the service key and emit:
- `og:title`: "انضم إلى {org} على العب".
- `og:title`: "انضم لـ {org} على العب".
- `og:description`: the welcome message, or the org description.
- `og:image`: the org's 1200x630 share card (feature C2), falling back to a themed default slot, `share_invite_card`.
- `twitter:card=summary_large_image`.
......@@ -412,22 +412,22 @@ The RPC runs these checks in order and returns the first failure. The Arabic cop
| Outcome | HTTP | Uses a seat? | What the player sees |
|---|---|---|---|
| `invalid_format` | 422 | no | "الكود ده شكله غلط. راجع الحروف والأرقام" |
| `invalid_format` | 422 | no | "الكود شكله غلط، راجعه" |
| `rate_limited` | 429 + `Retry-After` | no | "استنى {n} دقيقة وجرب تاني", with a live countdown |
| `not_found` | 404 | no | "الكود ده مش موجود. راجع الحروف", and the ticket shakes |
| `not_found` | 404 | no | "الكود ده مش موجود، راجعه", and the ticket shakes |
| `revoked` | 410 | no | "الكود ده اتلغى" |
| `not_started` | 409 | no | "الكود يشتغل يوم {date}" |
| `expired` | 410 | no | "ميعاد الكود ده خلص" |
| `expired` | 410 | no | "صلاحية الكود خلصت" |
| `exhausted` | 410 | no | "الكود ده اتستخدم لآخره", with the punched `.spent` corner |
| `account_required` | 401 | no | "اعمل حساب الأول عشان تدخل" and a register button; the code is kept |
| `banned_from_org` | 403 | no | "الكود ده مش متاح لحسابك" |
| `not_eligible` | 403 | no | Names the rule: "الكود ده للحسابات الجديدة بس" or "لازم توصل لمستوى {n}" |
| `not_eligible` | 403 | no | Names the rule: "الكود ده للحسابات الجديدة بس" or "لازم توصل ليفل {n}" |
| `already_redeemed` | 200 `{already:true}` | no | Opens the target; not treated as an error |
| `already_member` (same or higher role, no other grant) | 200 | no | Gold toast, "أنت عضو في {org} بالفعل", then opens the org |
| `already_member` (same or higher role, no other grant) | 200 | no | Gold toast, "إنت أصلاً عضو في {org}", then opens the org |
| `org_limit` (player is already in the maximum number of orgs, default 5) | 409 | no | Lists the player's orgs with leave buttons |
| `org_full` | 409 | no | "المنظمة كاملة" (a waitlist comes later) |
| `org_full` | 409 | no | "المنظمة كملت" (a waitlist comes later) |
| `pending_approval` | 202 | held (`reserved + 1`, released on rejection) | "طلبك وصل للإدارة" |
| `applied` / `partial` | 200 | yes | The reveal. A grant that failed shows as a greyed chip with its reason, for example "البطولة كاملة" |
| `applied` / `partial` | 200 | yes | The reveal. A grant that failed shows as a greyed chip with its reason, for example "البطولة كملت" |
Rules:
- **Membership.**
......@@ -606,7 +606,7 @@ POST {action:'redemption-reverse', redemption_id, reason}
- The call to action depends on state:
- signed in: "ادخل";
- guest or no account: "اعمل حسابك وادخل";
- already a member: "أنت عضو، افتح المنظمة".
- already a member: "إنت عضو، افتح المنظمة".
**3. Register.** The collapsed code row and the invitation card described in 2.6 C.
......@@ -616,7 +616,7 @@ POST {action:'redemption-reverse', redemption_id, reason}
- "انضم" (open);
- "قدّم طلب" (approval);
- "ادخل بالكود" (code only);
- "طلبك قيد المراجعة" (pending, as a ghost button);
- "طلبك بيتراجع" (pending, as a ghost button);
- a "عضو" ribbon for members, with leave in the menu.
- **Below:** announcements, upcoming org tournaments as tickets, top members, then all members as rows with real avatars and role chips.
- Owners and admins get an "إدارة" icon button.
......
......@@ -27,7 +27,7 @@ Every endpoint in this file answers one JSON object.
```json
{"ok": true, ...}
{"ok": false, "error": "expired", "message_key": "redeem.err_expired", "message": "ميعاد الكود ده خلص", ...details}
{"ok": false, "error": "expired", "message_key": "redeem.err_expired", "message": "صلاحية الكود خلصت", ...details}
```
- `error` is a stable key (tables in section 8). Code against it, never against `message`.
......@@ -166,7 +166,7 @@ the same body again answers `already_redeemed` with the original results, so ret
{"type": "org_join", "ok": true, "applied": true, "org_id": "uuid", "role": "member", "member_id": "uuid",
"upgraded": false, "rejoined": false},
{"type": "tournament_register", "ok": false, "applied": false, "tournament_id": "uuid", "reason": "tournament_full",
"waitlisted": false, "fee_waived": false, "reason_message": "البطولة كاملة"},
"waitlisted": false, "fee_waived": false, "reason_message": "البطولة كملت"},
{"type": "coins", "ok": true, "applied": true, "amount": 100, "source": "treasury", "balance": 1350}],
"navigate": {"scene": "org-home", "params": {"orgId": "uuid"}},
"welcome_message": null, "welcome_message_ar": "...", "was_new_signup": false}
......@@ -198,7 +198,7 @@ the same body again answers `already_redeemed` with the original results, so ret
"redemption_status": "applied|partial|pending_approval|rejected|reversed", "results": [], "created_at": "...",
"code": {}, "navigate": {}, "message": "استخدمت الكود ده قبل كده", "welcome_message": null, "welcome_message_ar": "..."}
{"ok": true, "status": "already_member", "org": {}, "code": {}, "navigate": {}, "message": "أنت عضو في نادي القاهرة بالفعل"}
{"ok": true, "status": "already_owned", "results": [], "code": {}, "message": "الحاجات دي عندك بالفعل"}
{"ok": true, "status": "already_owned", "results": [], "code": {}, "message": "الحاجات دي عندك أصلاً"}
```
A legacy group code answers `applied` with `redemption_id: null` and one `group_join` result, or
......@@ -252,7 +252,7 @@ the account**: the response always carries the tokens.
{"access_token": "...", "refresh_token": "...", "user": {},
"redeem": {"ok": true, "status": "applied", "...": "the 1.2 apply body"}}
{"access_token": "...", "refresh_token": "...", "user": {},
"redeem": {"ok": false, "error": "expired", "message_key": "redeem.err_expired", "message": "ميعاد الكود ده خلص", "keep_code": false}}
"redeem": {"ok": false, "error": "expired", "message_key": "redeem.err_expired", "message": "صلاحية الكود خلصت", "keep_code": false}}
```
`redeem` is null when no code was sent. `keep_code: true` on failures worth retrying later
......@@ -273,7 +273,7 @@ source `guest_upgrade`.
"profile": {"...": "full profile row"},
"redeem": {"...": "apply body for redeem_code, or for the first held code, or null"},
"intents": [{"code": "K7QM-4WXP", "ok": true, "status": "applied"},
{"code": "AHLY26", "ok": false, "error": "expired", "message": "ميعاد الكود ده خلص"}]}
{"code": "AHLY26", "ok": false, "error": "expired", "message": "صلاحية الكود خلصت"}]}
```
Store the new tokens (the old guest token still says `is_anonymous`). Errors (nothing changed in any
......@@ -282,7 +282,7 @@ of these):
| `error` | HTTP | Meaning / what to show |
|---|---|---|
| `email_exists` | 409 | `keep_code: true`. "الإيميل ده عليه حساب. سجل دخول بيه". Offer login; keep `link.pending` and redeem it on the next `auth:success`. |
| `username_taken` | 409 | "اسم المستخدم ده مأخوذ. جرب اسم تاني" |
| `username_taken` | 409 | "اسم المستخدم ده متاخد، جرّب اسم تاني" |
| `not_guest` | 409 | The token is already a permanent account |
| `invalid_email` | 422 | |
| `weak_password` | 422 | under 6 characters, or GoTrue refused it |
......@@ -343,7 +343,7 @@ there is none. Inactive orgs never appear. Order: verified first, then by member
| `join` | "انضم" (open policy): `POST join` |
| `apply` | "قدّم طلب" (approval): `POST apply` |
| `code` | "ادخل بالكود" (code only): open the redeem screen with `source: org_page` |
| `pending` | "طلبك قيد المراجعة" (ghost) |
| `pending` | "طلبك بيتراجع" (ghost) |
| `member` | the "عضو" ribbon; leave in the menu |
| `closed` | closed to new members |
| `full` | the org is full |
......@@ -449,28 +449,28 @@ membership state (section 3), and the notifications the manager sends.
| Key | HTTP | Arabic `message` |
|---|---|---|
| `invalid_format` | 422 | الكود ده شكله غلط. راجع الحروف والأرقام |
| `invalid_format` | 422 | الكود شكله غلط، راجعه |
| `rate_limited` | 429 | استنى {n} دقيقة وجرب تاني |
| `not_found` | 404 | الكود ده مش موجود. راجع الحروف |
| `not_found` | 404 | الكود ده مش موجود، راجعه |
| `revoked` | 410 | الكود ده اتلغى |
| `not_started` | 409 | الكود يشتغل يوم {date} |
| `expired` | 410 | ميعاد الكود ده خلص |
| `expired` | 410 | صلاحية الكود خلصت |
| `exhausted` | 410 | الكود ده اتستخدم لآخره |
| `account_required` | 403 | اعمل حساب الأول عشان تدخل |
| `banned_from_org` | 403 | الكود ده مش متاح لحسابك |
| `not_eligible` | 403 | per rule: الكود ده للحسابات الجديدة بس / لازم توصل لمستوى {n} / لازم تلعب {n} ماتشات الأول / حسابك لازم يكون عمره {n} يوم على الأقل / الكود ده مش متاح في بلدك |
| `not_eligible` | 403 | per rule: الكود ده للحسابات الجديدة بس / لازم توصل ليفل {n} / لازم تلعب {n} ماتشات الأول / لازم يعدّي على حسابك {n} يوم / الكود ده مش متاح في بلدك |
| `org_limit` | 409 | أنت في {n} منظمات، وده الحد الأقصى. اخرج من واحدة الأول |
| `org_full` | 409 | المنظمة كاملة |
| `org_full` | 409 | المنظمة كملت |
| `org_closed` | 409 | المنظمة دي مش بتستقبل أعضاء دلوقتي |
| `org_inactive` | 410 | المنظمة دي مش شغالة دلوقتي |
| `org_not_found` | 404 | المنظمة دي مش موجودة |
| `membership_suspended` | 403 | عضويتك في المنظمة دي متوقفة |
| `invalid_role` | 422 | الدور ده مش متاح |
| `tournament_full` | 409 | البطولة كاملة |
| `tournament_full` | 409 | البطولة كملت |
| `registration_closed` | 409 | التسجيل في البطولة قفل |
| `tournament_not_found` | 404 | البطولة دي مش موجودة |
| `group_not_found` | 404 | الجروب ده مش موجود |
| `group_full` | 409 | الجروب كامل |
| `group_full` | 409 | الجروب كمل |
| `blocked` | 403 | مش هتقدر تدخل الجروب ده |
| `frame_not_found` | 404 | الإطار ده مش موجود |
| `frame_sold_out` | 409 | الإطار ده خلص |
......@@ -481,8 +481,8 @@ membership state (section 3), and the notifications the manager sends.
| `invalid_request` | 400 | الطلب ده ناقص حاجة |
| `player_not_found` | 404 | حسابك مش موجود. سجل دخول تاني |
Success messages: `pending_approval` "طلبك وصل للإدارة", `already_member` "أنت عضو في {org} بالفعل",
`already_redeemed` "استخدمت الكود ده قبل كده", `already_owned` "الحاجات دي عندك بالفعل".
Success messages: `pending_approval` "طلبك وصل للإدارة", `already_member` "إنت أصلاً عضو في {org}",
`already_redeemed` "استخدمت الكود ده قبل كده", `already_owned` "الحاجات دي عندك أصلاً".
### 8.2 Orgs (`org.err_<key>`)
......@@ -492,23 +492,23 @@ Every 8.1 key can also come from `orgs.php` (with the `org.` prefix), plus:
|---|---|---|
| `org_required` | 400 | اختار المنظمة الأول |
| `approval_required` | 409 | المنظمة دي محتاجة طلب انضمام |
| `code_required` | 409 | الدخول للمنظمة دي بالكود بس |
| `already_pending` | 409 | طلبك قيد المراجعة بالفعل |
| `too_many_applications` | 409 | عندك طلبات كتير مستنية. استنى ردهم الأول |
| `not_member` | 404 | أنت مش عضو في المنظمة دي |
| `owner_must_transfer` | 409 | أنت مالك المنظمة. سلّم الملكية لحد تاني قبل ما تخرج |
| `code_required` | 409 | المنظمة دي بالكود بس |
| `already_pending` | 409 | طلبك وصل للإدارة، استنى ردهم |
| `too_many_applications` | 409 | طلباتك كتير، استنى ردهم الأول |
| `not_member` | 404 | إنت مش عضو في المنظمة دي |
| `owner_must_transfer` | 409 | إنت مالك المنظمة، سلّمها لحد تاني الأول |
| `invalid_field` | 422 | في خانة مش مظبوطة |
| `invalid_file` | 422 | نوع الملف ده مش مدعوم. استخدم JPG أو PNG أو WebP |
| `invalid_file` | 422 | الملف ده مش مقبول. ارفع JPG أو PNG أو WebP |
| `file_too_large` | 413 | الصورة كبيرة. أقصى حجم 5 ميجا |
| `upload_failed` | 502 | الرفع ما نجحش. جرب تاني |
| `upload_failed` | 502 | الرفع ماكملش، جرّب تاني |
### 8.3 Auth (`auth.err_<key>`)
`email_exists` 409 "الإيميل ده عليه حساب. سجل دخول بيه"; `username_taken` 409
"اسم المستخدم ده مأخوذ. جرب اسم تاني"; `not_guest` 409 "حسابك مسجل بالفعل"; `invalid_email` 422
"الإيميل ده مش مظبوط"; `weak_password` 422 "كلمة السر لازم تكون 6 حروف على الأقل";
"اسم المستخدم ده متاخد، جرّب اسم تاني"; `not_guest` 409 "حسابك متسجل أصلاً"; `invalid_email` 422
"الإيميل ده مش مظبوط"; `weak_password` 422 "الباسورد لازم يكون 6 حروف على الأقل";
`invalid_username` 422 "اسم المستخدم لازم يكون من 3 لـ 20 حرف"; `account_required` 401
"سجل دخول الأول"; `upgrade_failed` 502 "ما قدرناش نسجل حسابك دلوقتي. جرب تاني".
"سجل دخول الأول"; `upgrade_failed` 502 "مقدرناش نسجل حسابك دلوقتي، جرّب تاني".
---
......
......@@ -1041,9 +1041,9 @@ Use this Arabic text verbatim in `message`. P6 and P7 put the same text in their
| `registration_closed` | 409 | التسجيل اتقفل |
| `full` | 409 | البطولة كملت |
| `waitlist_full` | 409 | قائمة الانتظار كملت |
| `insufficient_coins` | 409 | رصيدك مش مكفي |
| `insufficient_coins` | 409 | عملاتك مش كفاية |
| `not_allowed` | 403 | مينفعش تسجل في البطولة دي |
| `not_eligible` | 403 | مش مستوفي شروط البطولة |
| `not_eligible` | 403 | شروط البطولة مش منطبقة عليك |
| `members_only` | 409 | البطولة دي لأعضاء النادي بس |
| `org_not_allowed` | 409 | ناديك مش من الأندية المشاركة |
| `org_quota_full` | 409 | عدد لاعبي ناديك كمل |
......@@ -1054,25 +1054,25 @@ Use this Arabic text verbatim in `message`. P6 and P7 put the same text in their
| `invalid_file` | 422 | الملف ده مش مقبول |
| `file_too_large` | 413 | الملف كبير، أقصى حجم {max_mb} ميجا |
| `upload_failed` | 502 | الرفع ماكملش، جرّب تاني |
| `unavailable` | 502 | في مشكلة دلوقتي، جرّب تاني كمان شوية |
| `unavailable` | 502 | فيه مشكلة، جرّب كمان شوية |
| `bad_request` | 422 | الطلب ناقص حاجة |
| `not_registered` | 404 | انت مش مسجل في البطولة دي |
| `not_registered` | 404 | إنت مش مسجّل في البطولة دي |
| `check_in_not_open` | 409 | تأكيد الحضور لسه مفتحش |
| `check_in_closed` | 409 | تأكيد الحضور اتقفل |
| `staff_only` | 403 | المنظمين هما اللي بيسجلوا حضورك |
| `staff_only` | 403 | المنظمين هيأكدوا حضورك |
| `venue_code_required` | 422 | اكتب كود المكان |
| `venue_code_wrong` | 422 | الكود ده مش صح |
| `pending_approval` | 409 | طلبك مع المنظمين |
| `form_incomplete` | 409 | كمّل بياناتك الأول |
| `not_member` | 403 | انت مش عضو في النادي ده |
| `not_member` | 403 | إنت مش عضو في النادي ده |
| `locked` | 409 | مينفعش تغير النادي دلوقتي |
| `byes_disabled` | 409 | الاستراحة مش متاحة في البطولة دي |
| `too_many_byes` | 409 | خدت كل الاستراحات المسموحة |
| `byes_disabled` | 409 | مفيش راحة في البطولة دي |
| `too_many_byes` | 409 | خلّصت كل مرات الراحة |
| `round_started` | 409 | الجولة دي اتوزّعت خلاص |
| `finished` | 409 | البطولة خلصت |
| `report_window_closed` | 409 | وقت البلاغ خلص |
| `not_your_game` | 403 | دي مش مباراتك |
| `already_reported` | 409 | بلغت عن المباراة دي قبل كده |
| `not_your_game` | 403 | ده مش ماتشك |
| `already_reported` | 409 | بلّغت عن الماتش ده قبل كده |
| `rate_limited` | 429 | استنى شوية وجرّب تاني |
Staff-facing keys (tournament-admin.php to the manager):
......@@ -1082,7 +1082,7 @@ Staff-facing keys (tournament-admin.php to the manager):
| `invalid_stage` | 422 | إعدادات المرحلة فيها غلط |
| `stages_locked` | 409 | مينفعش تغير المراحل بعد البداية |
| `not_in_cut_review` | 409 | مفيش مراجعة تأهل دلوقتي |
| `next_started` | 409 | المباراة اللي بعدها بدأت |
| `next_started` | 409 | الماتش اللي بعده بدأ |
| `player_in_other_team` | 409 | اللاعب ده في فريق تاني |
| `not_org_member` | 409 | اللاعب مش عضو في النادي |
| `lineup_locked` | 409 | التشكيلة اتقفلت للجولة دي |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment