skills/vendix-fiscal-scope/SKILL.md
Organization fiscal scope for Vendix: STORE vs ORGANIZATION legal/tax entity behavior, DIAN configuration ownership, fiscal accounting entities, fiscal reports, and intercompany transfers. Trigger: When working with organizations.fiscal_scope, fiscal accounting entities, DIAN NIT ownership, fiscal reports by NIT, fiscal scope migrations, or intercompany stock-transfer entries.
npx skillsauth add rzyfront/vendix vendix-fiscal-scopeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill whenever a change depends on whether an organization is one legal/tax entity or each store is its own legal/tax entity.
Fiscal scope is independent from operating scope. Operating scope controls operational sharing such as inventory and locations. Fiscal scope controls invoicing, DIAN configuration ownership, accounting entity selection, fiscal periods, and tax reports.
fiscal_scope=STORE: every active store needs its own fiscal accounting entity and DIAN invoicing configuration.fiscal_scope=ORGANIZATION: the organization uses one consolidated fiscal accounting entity.operating_scope=STORE + fiscal_scope=ORGANIZATION is invalid.operating_scope=ORGANIZATION + fiscal_scope=STORE is valid and means inventory may move cross-store while invoices/reports remain separated by store NIT.FiscalScopeService; do not use OperatingScopeService.resolveAccountingEntity() for invoicing, DIAN, tax reports, or automatic accounting entries.FiscalScopeMigrationService so blockers, force reasons, cache invalidation, and audit logs are preserved.STORE_ADMIN maps to operating_scope=STORE, fiscal_scope=STORE.ORG_ADMIN maps to operating_scope=ORGANIZATION, fiscal_scope=ORGANIZATION.ORG_ADMIN maps to operating_scope=ORGANIZATION, fiscal_scope=STORE.ORGANIZATION -> STORE) is blocked by pending DIAN invoices, pending DIAN responses, open consolidated fiscal periods, missing store DIAN configs, missing store tax IDs, and open intercompany/consolidation records.STORE -> ORGANIZATION) cannot be forced through invalid operating/fiscal combinations.organizations.fiscal_scope is the organization-level fiscal source of truth.accounting_entities must include fiscal_scope; fiscal uniqueness must include fiscal scope and protect active consolidated entities where store_id IS NULL.dian_configurations.store_id remains the compatibility anchor, with accounting_entity_id derived from fiscal scope.fiscal_scope_audit_log is separate from operating_scope_audit_log.accounting_entries.accounting_entity_id.store_id filters are operational breakdowns; accounting_entity_id filters are fiscal/legal filters.operating_scope=ORGANIZATION + fiscal_scope=STORE, cross-store stock transfers are operationally allowed but fiscally intercompany.intercompany_transfer.shipped.receivableintercompany_transfer.shipped.inventoryintercompany_transfer.received.inventoryintercompany_transfer.received.payablevendix-operating-scopevendix-auto-entriesvendix-accounting-rulesvendix-prisma-migrationsvendix-validationdevelopment
Mobile app development rules for Vendix Expo/React Native project. Trigger: When editing, creating, or modifying any file under apps/mobile, or when developing mobile-specific features.
development
Feature gating by store subscription state: global store write guard, AI feature gate, Redis feature resolution, quota consumption, frontend paywall interceptor, banner, and subscription UI states. Trigger: When adding feature gates, paywalls, subscription-based access control, protecting store write operations, AI feature gates, or rollout flags.
testing
SaaS subscription billing for Vendix stores: plan pricing, invoices, Wompi platform payments, manual payments, partner commissions, payouts, proration, and dunning. Trigger: When creating SaaS invoices, working with partner rev-share, margin/surcharge pricing, invoice sequence allocation, partner payout batches, subscription payments, manual payments, or dunning flows.
development
Periodic quota counters with Redis, UTC period keys, Lua-based idempotent AI quota consumption, request-id deduplication, and post-success consumption. Trigger: When building quota counters, enforcing monthly/daily feature caps, or reusing AI quota patterns for uploads, emails, exports, or rate-limited features.