Create, modify, review, or test the Vendra Affiliate API package in packages/vendra-affiliate-api. Use for the public affiliates JSON:API server, AffiliateSchema, AffiliateResource, collection/resource queries, active-affiliate visibility, filters, routes, response fields, API tests, and AffiliateApiServiceProvider wiring.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Create, modify, review, or test the Vendra Affiliate API package in packages/vendra-affiliate-api. Use for the public affiliates JSON:API server, AffiliateSchema, AffiliateResource, collection/resource queries, active-affiliate visibility, filters, routes, response fields, API tests, and AffiliateApiServiceProvider wiring.
Vendra Affiliate API
Workflow
Translatable Persistence
Making a persisted model field translatable is an explicit domain choice unless this package already requires it.
Every field listed in a model's $translatable array must definitely use a JSON database column. Keep its model traits/casts, factories, validation, Filament locale UI, API serialization, and tests translation-aware.
A field not listed in $translatable must use the appropriate scalar database type and must not use Spatie Translatable, translatable slug traits, locale switchers, translated callbacks, or translation-shaped array data.
Use vendra-api-development for shared JSON:API infrastructure, laravel-best-practices for Laravel PHP and pest-testing when tests change. Before editing, inspect the installed versions with Laravel Boost and search the version-specific documentation for the affected JSON:API behavior.
Boundary And Contract
Work inside packages/vendra-affiliate-api with namespace Misaf\VendraAffiliateApi.
Reuse Misaf\VendraAffiliate\Models\Affiliate; do not duplicate affiliate persistence, status transitions, commissions, referrals, or payouts.
Preserve the public read-only contract: expose active affiliates only and serialize only code and created_at.
Apply active status in AffiliateSchema::newQuery() so index, filter, and show endpoints cannot diverge.
Keep filters intentionally narrow and never expose user relationships or financial fields.
Inherit tenant scoping from the domain model and keep the production Misaf\VendraAffiliateApi namespace free of Misaf\VendraTenant. Feature tests may use a concrete tenant factory solely to establish tenant context.
Change Checklist
Update the schema, resource, collection/resource queries, server, and routes together when the contract changes.
Add focused Pest coverage for public fields, active/suspended visibility, filtering, pagination, routes, and server schema registration.
Preserve the architecture expectation that Misaf\VendraAffiliateApi does not use Misaf\VendraTenant.
Run composer --working-dir=packages/vendra-affiliate-api test and composer --working-dir=packages/vendra-affiliate-api analyse; run Pint when PHP changes.