gsl-review
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Plugin de Product Review Vendure

Este é um plugin para o framework de e-commerce Vendure projetado para gerenciar funcionalidades relacionadas a avaliação do produto comprado pelo cliente. Ele também permite o gerenciamento de aceitar ou negar essa avaliação por parte do backoffice ao projeto Gseller.

Após configurar o seu projeto Vendure, você pode usar este plugin via npm install:

npm install review-plugin

e inclua-o no arquivo vendure-config conforme abaixo:


import { ReviewsPlugin } from "review-plugin";
...
export const config: VendureConfig = {
  ...
  plugins: [
    ...,
	ReviewsPlugin
  ]
}

Os tipos, entradas e mutações atualizadas após a instalação do plugin são:

Common Api Main Type

 type ProductReview implements Node {
    id: ID!
    createdAt: DateTime!
    updatedAt: DateTime!
    product: Product!
    productVariant: ProductVariant
    summary: String!
    body: String
    rating: Float!
    authorName: String!
    authorLocation: String
    upvotes: Int!
    downvotes: Int!
    state: String!
    response: String
    responseCreatedAt: DateTime
  }

    type ProductReviewList implements PaginatedList {
    items: [ProductReview!]!
    totalItems: Int!
  }

  type ProductReviewHistogramItem {
    bin: Int!
    frequency: Int!
  }

   extend type Product {
    reviews(options: ProductReviewListOptions): ProductReviewList!
    reviewsHistogram: [ProductReviewHistogramItem!]!
  }

Common Api Inputs

  # Auto-generated at runtime
  input ProductReviewListOptions

Admin Main Type

  extend type ProductReview {
    author: Customer
  }

Admin Inputs

   input UpdateProductReviewInput {
    id: ID!
    summary: String
    body: String
    response: String
  }

Admin Query and Mutation

   extend type Query {
    productReviews(options: ProductReviewListOptions): ProductReviewList!
    productReview(id: ID!): ProductReview
  }

  extend type Mutation {
    updateProductReview(input: UpdateProductReviewInput!): ProductReview!
    approveProductReview(id: ID!): ProductReview
    rejectProductReview(id: ID!): ProductReview
  }

Shop Input

  input SubmitProductReviewInput {
    productId: ID!
    variantId: ID
    customerId: ID
    summary: String!
    body: String!
    rating: Float!
    authorName: String!
    authorLocation: String
  }

Shop Mutation

   extend type Mutation {
    submitProductReview(input: SubmitProductReviewInput!): ProductReview!
    voteOnReview(id: ID!, vote: Boolean!): ProductReview!
  }

Readme

Keywords

none

Package Sidebar

Install

npm i gsl-review

Weekly Downloads

2

Version

0.0.3

License

ISC

Unpacked Size

394 kB

Total Files

35

Last publish

Collaborators

  • caiquereis