Skip to content

feat: Inventory management, admin audit log backend, and promo code checkout integration#1255

Open
Thommyy7 wants to merge 1 commit into
DistinctCodes:mainfrom
Thommyy7:feature/thommyy7-issues-1202-1203-1204-1205
Open

feat: Inventory management, admin audit log backend, and promo code checkout integration#1255
Thommyy7 wants to merge 1 commit into
DistinctCodes:mainfrom
Thommyy7:feature/thommyy7-issues-1202-1203-1204-1205

Conversation

@Thommyy7

Copy link
Copy Markdown
Contributor

Summary

This PR implements four features assigned to Thommyy7:

[BE-28] Inventory Management: Backend (#1203)

  • New InventoryItem entity: name, category, serialNumber (nullable, unique), location, condition (GOOD/FAIR/NEEDS_REPAIR/RETIRED), assignedToUserId (nullable FK), assignedAt, purchasedAt, notes, isDeleted (soft delete)
  • POST /inventory — add item (admin only)
  • PATCH /inventory/:id — update details, condition, or location (admin only)
  • DELETE /inventory/:id — soft-delete / retire item (admin only; only if unassigned)
  • GET /inventory — list items (admin/staff, filterable by category, condition, location, assignedToUserId)
  • POST /inventory/:id/assign — assign to member (admin only)
  • POST /inventory/:id/unassign — release from member (admin only)
  • InventoryModule registered in AppModule

[FE-25] Inventory Management: Frontend (#1204)

  • /admin/inventory page with data table: Name, Category, Serial No., Location, Condition badge (colour-coded), Assigned To
  • Condition badge colours: green (Good), amber (Fair), red (Needs Repair), grey (Retired)
  • Category and condition filter dropdowns
  • Add Item button → form modal with all required fields
  • useGetInventory, useCreateInventoryItem, useUpdateInventoryItem, useAssignInventoryItem React Query hooks

[BE-29] Admin Audit Log: Backend (#1205)

  • New AuditLog entity: actorUserId, action, resourceType, resourceId, metadata (JSONB), ipAddress, createdAt (immutable records — no update/delete endpoints)
  • AuditLogService.log() method for use by other services
  • GET /audit-log — paginated, filterable by actorId, resourceType, startDate, endDate (super_admin only)
  • AuditLogModule registered in AppModule and exported for use by other modules

[FE-24] Discount / Promo Codes: Frontend - Checkout Integration (#1202)

  • "Have a promo code?" collapsible field added to BookingForm below the price estimate
  • Apply button calls POST /promo-codes/validate; on success shows discount line (Discount: -₦X) and updates displayed final amount
  • Inline error messages for invalid/expired/limit-reached codes
  • Remove link clears the applied code and restores original price
  • promoCode state tracked in form for future POST /bookings body integration

Closes #1203
Closes #1204
Closes #1205
Closes #1202

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Thommyy7 is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Thommyy7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant