Skip to content

feat(admin subscription): add page subscription and tabs - #1074

Open
alireza013013 wants to merge 23 commits into
GamaEdtech:upgrade-v4from
alireza013013:feat/admin-subscription
Open

feat(admin subscription): add page subscription and tabs#1074
alireza013013 wants to merge 23 commits into
GamaEdtech:upgrade-v4from
alireza013013:feat/admin-subscription

Conversation

@alireza013013

Copy link
Copy Markdown
Collaborator

Description

  • implement admin subscription plan management API composable and types
  • add another types for input post,put useApiService for handle object in object or list
  • add admin subscription feature management functionality and handle api in composable
  • add admin subscription price management functionality in composable
  • add admin subscription gateway mapping functionality in composable
  • remove getItemById from feature,gateway,price
  • add page subscription
  • add tabs for price,plan,gatway,feature
  • complete plan tab and get data show in table
  • add modal for add and detail and delete plan
  • complete feature tab and get data show in table
  • add modal for add and detail and delete feature
  • add feature management for admin subscription plans by adding feature modal
  • complete price tab and get data show in table
  • add modal for add and detail and delete price
  • add modal for add and detail and delete gateway

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please describe):

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings/errors
  • I have added tests that prove my fix is effective or that my feature works

- implement admin subscription plan management API composable and types
- add another types for input post,put useApiService for handle object in object or list
- add admin subscription feature management functionality and handle api in composable
- add page subscription
- add tabs for price,plan,gatway,feature
- complete plan tab and get data show in table
- add modal for add and detail and delete plan
- complete feature tab and get data show in table
- add modal for add and detail and delete featur
- add feature management for admin subscription plans by adding feature modal
- complete price tab and get data show in table
- add modal for add and detail and delete price
- add modal for add and detail and delete gateway
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@alireza013013 is attempting to deploy a commit to the GamaEdtech Team on Vercel.

A member of the Team first needs to authorize it.

@sanaderi sanaderi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review

Good adherence to the project's existing composable/CRUD conventions structurally, but there's a real correctness bug that should be fixed before merge, plus a nav placement note.

Bugs to fix before merge

Module-level singleton state in all four new composables — cross-tab data corruption

In every composables/api/subscription/*.api.ts file, several ref()s are declared outside the exported function (module scope), making them shared singletons across every call site for the app's entire lifetime, instead of being scoped per composable instance:

  • useSubscriptionFeatureAdmin.api.tsdata, featureOptions, totalCount, pageCount, and all loading flags are module-level.
  • useSubscriptionPlanAdmin.api.tstotalCount, pageCount, planFeatures, and loading flags are module-level (only data/loadingGetData are correctly scoped per-call, inconsistently with the rest).
  • Same pattern in the price and gateway-mapping composables.

This isn't theoretical — it's concretely triggered by this PR's own code, because all four tabs mount at once (Vuetify's v-window renders every v-window-item up front, not lazily):

  • prices/form.vue calls useSubscriptionPlanAdmin().getPlans({ page: 1, pageSize: 1000 }) on mount to populate the "Plan" dropdown when adding/editing a Price. Since totalCount/pageCount are the same refs plans/index.vue's pagination UI reads, opening "Add Price" after visiting the Plans tab will silently corrupt the Plans tab's displayed count and page-count.
  • gateway-mappings/form.vue does the identical thing with useSubscriptionPriceAdmin().getPrices({ page: 1, pageSize: 1000 }) to populate its "Price" dropdown — but here data itself is shared too, so opening "Add Gateway Mapping" will overwrite the Prices tab's own paginated table (10/20/50 rows) with up to 1000 rows and recompute its pageCount to 1, visibly breaking the Prices tab.

Fix: move all these refs inside the exported composable function (matching how data/loadingGetData are already scoped correctly in the plan composable — the pattern just needs to be applied consistently everywhere). This also sidesteps the general Nuxt/SSR hazard of module-scoped state being created once per server process rather than per request.

Navigation placement

The new "Subscription" menu item (app/layouts/admin.vue) is currently added under the Caption group (alongside Contact Us, User Management, Tags, Transactions, Payments). Please move it to the General group, next to Settings, instead.

Style / consistency (low severity)

  • app/layouts/admin.vue — new menu entry title is 'Subscription ' with a trailing space.
  • Detail-fetch strategy is inconsistent: plans/detail.vue re-fetches the item by ID via getItemById on modal open, while features/detail.vue, prices/detail.vue, and gateway-mappings/detail.vue just receive the already-loaded row object as a prop (no extra request). Not wrong, but worth aligning — the plan list already has full data available, so the extra round-trip is avoidable.

- Remove billingInterval from subscription plan forms and DTOs.
- Show plan price entries with their own billing intervals.
- Add required billingInterval support to subscription price forms and DTOs.
- Display billing interval in the admin prices table.
- Update plan feature types and API payloads to use `featureGroups`.
- Replace single feature picker with Vuetify multiple select.
- Add conditional description field for multi-feature groups.
- Display feature group descriptions and count grouped features in plan list.
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.

2 participants