Skip to content

v7.0.0

Latest
Compare
Choose a tag to compare
@samchon samchon released this 08 Jun 21:03

The new SDK generation mode keyword.

This is a special update for supporting AI coding (@autobe).

/**
 * Update an inquiry comment.
 *
 * Update an {@link IShoppingSaleInquiryComment inquiry comment} to a specific
 * {@link IShoppingSaleQuestion question} or {@link IShoppingSaleReview review}.
 *
 * By the way, as is the general policy of this shopping mall regarding
 * comments, modifying a comment does not actually change the existing content.
 * Modified content is accumulated and recorded in the existing comment record
 * as a new {@link IShoppingSaleInquiryComment.ISnapshot snapshot}. And this
 * is made public to everyone, who can read this inquiry comment.
 *
 * This is to prevent customers or sellers from modifying their comments and
 * manipulating the circumstances due to the nature of e-commerce, where
 * disputes easily arise. That is, to preserve evidence.
 *
 * @param props.saleId Belonged sale's {@link IShoppingSale.id }
 * @param props.inquiryId Belonged inquiry's {@link IShoppingSaleInquiry.id }
 * @param props.id Target inquiry comment's {@link IShoppingSaleInquiryComment.id }
 * @param props.body Update info of the inquiry comment
 * @returns Newly created snapshot record of the inquiry comment
 * @tag Sale
 * @author Samchon
 *
 * @controller ShoppingCustomerSaleQuestionCommentController.update
 * @path PUT /shoppings/customers/sales/:saleId/questions/:inquiryId/comments/:id
 * @nestia Generated by Nestia - https://github.com/samchon/nestia
 */
export async function update(
  connection: IConnection,
  props: update.Props,
): Promise<update.Output> {
  return PlainFetcher.fetch(
    {
      ...connection,
      headers: {
        ...connection.headers,
        "Content-Type": "application/json",
      },
    },
    {
      ...update.METADATA,
      template: update.METADATA.path,
      path: update.path(props),
    },
    props.body,
  );
}
export namespace update {
  export type Props = {
    /**
     * Belonged sale's
     */
    saleId: string & Format<"uuid">;

    /**
     * Belonged inquiry's
     */
    inquiryId: string & Format<"uuid">;

    /**
     * Target inquiry comment's
     */
    id: string & Format<"uuid">;

    /**
     * Update info of the inquiry comment
     */
    body: Body;
  };
  export type Body = IShoppingSaleInquiryComment.ICreate;
  export type Output = IShoppingSaleInquiryComment.ISnapshot;

  export const METADATA = {
    method: "PUT",
    path: "/shoppings/customers/sales/:saleId/questions/:inquiryId/comments/:id",
    request: {
      type: "application/json",
      encrypted: false,
    },
    response: {
      type: "application/json",
      encrypted: false,
    },
    status: 200,
  } as const;

  export const path = (props: Omit<Props, "body">) =>
    `/shoppings/customers/sales/${encodeURIComponent(props.saleId?.toString() ?? "null")}/questions/${encodeURIComponent(props.inquiryId?.toString() ?? "null")}/comments/${encodeURIComponent(props.id?.toString() ?? "null")}`;
}

What's Changed

Full Changelog: v6.0.6...v7.0.0