From 3466e19d13fc06c4e6b1341d0f78d0804f1f2621 Mon Sep 17 00:00:00 2001 From: Xlxinxi Date: Sat, 1 Aug 2026 01:36:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=8C=96shop-crm-age?= =?UTF-8?q?nt=E9=A1=B9=E7=9B=AE=EF=BC=8C=E5=AE=9E=E7=8E=B0=E5=9F=BA?= =?UTF-8?q?=E7=A1=80CLI=E4=B8=8ECRM=E6=93=8D=E4=BD=9C=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本提交初始化完整的shop-crm-agent项目: 1. 创建基础项目结构与配置文件(.gitignore、go.mod/go.sum) 2. 添加项目许可协议与文档(README.md、AGENTS.md、SKILL.md) 3. 实现核心CLI入口与命令框架 4. 封装Protobuf API客户端与完整的命令实现 5. 添加单元测试覆盖核心功能与边界情况 6. 提供构建脚本与版本管理能力 --- .gitignore | 9 + AGENTS.md | 37 + LICENSE | 12 + README.md | 75 + SKILL.md | 50 + cmd/shop-crm-agent/main.go | 17 + go.mod | 13 + go.sum | 14 + internal/api/shop_crm_agent.pb.go | 6759 +++++++++++++++++++++++++++++ internal/client/client.go | 166 + internal/client/client_test.go | 156 + internal/command/commands.go | 455 ++ internal/command/commands_test.go | 94 + internal/command/edit.go | 568 +++ scripts/build.go | 129 + 15 files changed, 8554 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 SKILL.md create mode 100644 cmd/shop-crm-agent/main.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/api/shop_crm_agent.pb.go create mode 100644 internal/client/client.go create mode 100644 internal/client/client_test.go create mode 100644 internal/command/commands.go create mode 100644 internal/command/commands_test.go create mode 100644 internal/command/edit.go create mode 100644 scripts/build.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d49cdd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/bin/ +.env +.env.* +*.log +.DS_Store +.idea/ +.vscode/ +*.swp +*.tmp diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..a1b88dd --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,37 @@ +# AGENTS.md + +本仓库是 `shop-crm-agent` 的唯一源码仓库。默认使用中文沟通。 + +## 项目边界 + +- 客户端只通过 `/api/shop/crm-agent/v1` Protobuf HTTP API 工作,不直接访问数据库、Redis、LightCore 配置或后端运行容器。 +- Go module 固定为 `code.zhecent.com/open/shop-crm-agent`,不得引入 LightCore backend module、Gin、GORM、数据库驱动或 Redis 客户端。 +- `internal/api/shop_crm_agent.pb.go` 是生成代码,不得手工编辑。 +- Protobuf schema 的唯一真相位于同级 `../LightCore/backend/application/shop/interfaces/crm_agent_proto/proto/shop_crm_agent.proto`。 +- 协议变更必须从 `../LightCore/backend` 执行 `bash scripts/proto_gen_shop_crm_agent.sh`,同时检查两个仓库的生成结果和测试。 + +## CLI 契约 + +- 所有业务命令输出 Protobuf JSON,不输出表格或混合说明文本。 +- 业务失败先输出服务端结构化响应再返回非零退出码;运输或解析失败不得伪造业务响应。 +- 写命令必须使用稳定且唯一的 `--request-id`;同一操作重试时复用原 request ID 和原参数。 +- 报价编辑固定使用 `begin -> command -> preview -> commit`,放弃时使用 `discard`。 +- 项目和报价删除必须先执行对应 `delete-preview`,不得绕过 revision 与 `changeSetId`。 +- CLI 只读取 `LIGHTCORE_API_BASE_URL` 和 `LIGHTCORE_SHOP_CRM_AGENT_TOKEN`;缺失时明确失败,不回退 localhost。 +- Token 不得写入源码、文件、日志或输出;测试只能使用明显虚构的占位值。 + +## 开发流程 + +1. 先读取相邻实现和 `SKILL.md`,确认命令边界与安全流程。 +2. 只修改职责明确的 command/client 代码,不在客户端复制服务端业务规则。 +3. 生成代码只通过 LightCore 的协议生成脚本更新。 +4. 执行 `go test ./...` 和 `go build ./...`。 +5. 执行 `go run ./scripts/build.go`,确认 `bin/shop-crm-agent[.exe] --version` 可运行。 +6. 用 `rg` 检查 Token、Secret、内部绝对路径和意外的后端依赖。 + +## Git 与更新 + +- `main` 必须始终可测试、可构建;禁止 force push。 +- 更新只使用 `git pull --ff-only`。 +- 工作区有本地修改时不得自动覆盖、重置或清理。 +- 本仓库不提交编译产物,不提供二进制自更新或预编译 Release。 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c5da442 --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright (c) 2026 Zhecent. All rights reserved. + +This source code is made publicly readable for review and for authorized +Zhecent employees to use solely for Zhecent's internal business purposes. + +No permission is granted to any other person or organization to copy, modify, +distribute, sublicense, sell, or otherwise use this source code without prior +written permission from Zhecent. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9135ca7 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# shop-crm-agent + +`shop-crm-agent` 是通过正式 Protobuf HTTP API 操作 Shop CRM 项目和独立报价的受控命令行客户端。源码允许匿名读取,但使用业务 API 仍需要管理员签发的 CRM Agent 凭据。 + +## 环境要求 + +- Git +- Go 1.26 或更高版本 +- 可访问目标 LightCore API 的网络环境 +- 运行环境提供 `LIGHTCORE_API_BASE_URL` 和 `LIGHTCORE_SHOP_CRM_AGENT_TOKEN` + +仓库在开发工作区中固定与 `LightCore` 同级。例如: + +```text +/ +├── LightCore/ +└── shop-crm-agent/ +``` + +普通构建不依赖 `LightCore` 仓库;只有修改 Protobuf 契约时才需要同级的 LightCore 源码。 + +## 首次安装 + +```bash +git clone https://code.zhecent.com/open/shop-crm-agent.git +cd shop-crm-agent +go run ./scripts/build.go +./bin/shop-crm-agent --version +``` + +Windows 构建产物为 `bin/shop-crm-agent.exe`。构建脚本执行测试后,只编译当前操作系统和 CPU 架构,不安装系统服务,也不修改全局 PATH。 + +运行业务命令前,由当前 Shell 或 Agent 的受控运行环境提供配置: + +```bash +export LIGHTCORE_API_BASE_URL=https://api.example.com +``` + +`LIGHTCORE_SHOP_CRM_AGENT_TOKEN` 必须通过密码管理器、受控 Secret 注入或其他不会回显和记录明文的机制提供。不要在交互式命令中直接输入真实 Token,也不得把它写入仓库、Skill、`.env`、命令历史、普通日志或聊天内容。 + +## 更新 + +收到内部更新通知后,让 Agent 在仓库根目录执行: + +```bash +git status --short +git pull --ff-only +``` + +确认拉取成功后,Agent 必须重新读取最新的 `SKILL.md`,再执行: + +```bash +go run ./scripts/build.go +./bin/shop-crm-agent --version +``` + +如果工作区存在本地修改,必须先停止更新并确认修改来源,不得强制重置。只有重新构建和版本探针都通过后才可继续执行 CRM 操作。 + +## 开发验证 + +```bash +go test ./... +go build ./... +go run ./scripts/build.go +``` + +`internal/api/shop_crm_agent.pb.go` 是生成代码,不得手工编辑。协议源文件位于同级 LightCore 仓库,生成入口为: + +```bash +(cd ../LightCore/backend && bash scripts/proto_gen_shop_crm_agent.sh) +``` + +## 许可 + +本仓库保留全部权利,仅授权 Zhecent 员工用于公司内部业务。详见 `LICENSE`。 diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..2765ee8 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,50 @@ +--- +name: lc-shop-crm-agent +description: 安装、更新并安全使用 shop-crm-agent 查询和维护 Shop CRM 项目与独立报价。 +--- + +# lc-shop-crm-agent - Shop CRM Agent 操作流程 + +## 目的 + +指导 AI Agent 从公开源码构建 `shop-crm-agent`,并通过正式 Protobuf API 安全操作 CRM 项目和独立报价。 + +## 安装与更新 + +1. 仓库固定 clone 为工作区中的 `shop-crm-agent` 目录;与 LightCore 联合开发时二者必须同级。 +2. 缺少仓库时,从 `https://code.zhecent.com/open/shop-crm-agent.git` 匿名 clone,不使用来源不明的压缩包或二进制。 +3. 检查 `go version` 满足 `go.mod`;缺少 Go 时安装官方 Go 工具链,再继续构建。 +4. 首次安装在仓库根目录执行 `go run ./scripts/build.go`,使用 `bin/shop-crm-agent`;Windows 使用 `bin/shop-crm-agent.exe`。 +5. 收到更新通知后先确认 `git status --short` 为空,再执行 `git pull --ff-only`;拉取后重新读取本文件并重新构建。 +6. 本地存在修改、拉取失败、测试失败、构建失败或版本探针失败时停止,不得强制重置或继续使用半完成产物。 + +## 运行配置 + +- 确认 `LIGHTCORE_API_BASE_URL` 和 `LIGHTCORE_SHOP_CRM_AGENT_TOKEN` 已由运行环境提供;不得显示、记录或提交 Token。 +- 凭据只通过 Shop 管理后台创建和撤销;CLI 不管理凭据。 +- 业务命令使用仓库 `bin/` 下的当前构建产物,精确参数以 ` --help` 为准。 + +## 操作流程 + +1. 创建项目前用 `customer-list` 获取真实客户 ID;其他操作先查询真实项目、报价、SKU、层级和产品行 ID。 +2. 每个写命令使用稳定且唯一的 `--request-id`;重试同一操作时复用原 ID 和完全相同的参数。 +3. 报价内容修改严格执行 `begin -> command -> preview -> commit`;不提交时执行 `discard`。 +4. 删除先执行 `delete-preview`,只使用其返回的 revision 和 `changeSetId`;`allowed=false` 时停止。 +5. 读取 JSON 响应的 `header.code`、`header.replayed`、revision、`changeSetId` 与 `affectedLineIds`,不得只凭进程退出码推断业务状态。 + +## 阻塞检查点 + +- 需求超出项目主线和独立报价时停止;不得转向客户维护、合同、设计画板、跟进、资金、文件、采购或产品库维护。 +- 产品库行只提交真实 `sku-id`,不得尝试修改产品库成本;自定义行仅通过明确 flag 修改自身成本。 +- 非空层级删除只有用户意图明确时才使用 `--cascade`。 +- 项目非空、报价锁定、revision 变化、changeSet 不一致或回执状态未知时不得强行继续。 +- 请求取消、超时或结果不确定时先查询资源状态,不得盲目生成新 request ID 重复写入。 + +## 验证 + +```bash +go test ./... +go build ./... +go run ./scripts/build.go +./bin/shop-crm-agent --version +``` diff --git a/cmd/shop-crm-agent/main.go b/cmd/shop-crm-agent/main.go new file mode 100644 index 0000000..6834f3b --- /dev/null +++ b/cmd/shop-crm-agent/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "os" + + "code.zhecent.com/open/shop-crm-agent/internal/command" +) + +var version = "dev" + +func main() { + if err := command.New(version).Execute(); err != nil { + _, _ = fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..50d2b03 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module code.zhecent.com/open/shop-crm-agent + +go 1.26 + +require ( + github.com/spf13/cobra v1.10.2 + google.golang.org/protobuf v1.36.11 +) + +require ( + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/pflag v1.0.9 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d56c5f7 --- /dev/null +++ b/go.sum @@ -0,0 +1,14 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= +github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/api/shop_crm_agent.pb.go b/internal/api/shop_crm_agent.pb.go new file mode 100644 index 0000000..06e6d58 --- /dev/null +++ b/internal/api/shop_crm_agent.pb.go @@ -0,0 +1,6759 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v6.33.0 +// source: shop_crm_agent.proto + +package dto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ResponseHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + Replayed bool `protobuf:"varint,4,opt,name=replayed,proto3" json:"replayed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseHeader) Reset() { + *x = ResponseHeader{} + mi := &file_shop_crm_agent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResponseHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseHeader) ProtoMessage() {} + +func (x *ResponseHeader) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseHeader.ProtoReflect.Descriptor instead. +func (*ResponseHeader) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{0} +} + +func (x *ResponseHeader) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ResponseHeader) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ResponseHeader) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *ResponseHeader) GetReplayed() bool { + if x != nil { + return x.Replayed + } + return false +} + +type CommandHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommandHeader) Reset() { + *x = CommandHeader{} + mi := &file_shop_crm_agent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommandHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandHeader) ProtoMessage() {} + +func (x *CommandHeader) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommandHeader.ProtoReflect.Descriptor instead. +func (*CommandHeader) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{1} +} + +func (x *CommandHeader) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +type CommonResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResponse) Reset() { + *x = CommonResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResponse) ProtoMessage() {} + +func (x *CommonResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead. +func (*CommonResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{2} +} + +func (x *CommonResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +type PageInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PageInfo) Reset() { + *x = PageInfo{} + mi := &file_shop_crm_agent_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageInfo) ProtoMessage() {} + +func (x *PageInfo) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PageInfo.ProtoReflect.Descriptor instead. +func (*PageInfo) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{3} +} + +func (x *PageInfo) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *PageInfo) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *PageInfo) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type Customer struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + Province string `protobuf:"bytes,6,opt,name=province,proto3" json:"province,omitempty"` + City string `protobuf:"bytes,7,opt,name=city,proto3" json:"city,omitempty"` + District string `protobuf:"bytes,8,opt,name=district,proto3" json:"district,omitempty"` + CreatedAt int64 `protobuf:"varint,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Customer) Reset() { + *x = Customer{} + mi := &file_shop_crm_agent_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Customer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Customer) ProtoMessage() {} + +func (x *Customer) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Customer.ProtoReflect.Descriptor instead. +func (*Customer) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{4} +} + +func (x *Customer) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Customer) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Customer) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *Customer) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Customer) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Customer) GetProvince() string { + if x != nil { + return x.Province + } + return "" +} + +func (x *Customer) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *Customer) GetDistrict() string { + if x != nil { + return x.District + } + return "" +} + +func (x *Customer) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Customer) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +type CustomerListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CustomerListRequest) Reset() { + *x = CustomerListRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CustomerListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CustomerListRequest) ProtoMessage() {} + +func (x *CustomerListRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CustomerListRequest.ProtoReflect.Descriptor instead. +func (*CustomerListRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{5} +} + +func (x *CustomerListRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *CustomerListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *CustomerListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type CustomerListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Customers []*Customer `protobuf:"bytes,2,rep,name=customers,proto3" json:"customers,omitempty"` + Page *PageInfo `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CustomerListResponse) Reset() { + *x = CustomerListResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CustomerListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CustomerListResponse) ProtoMessage() {} + +func (x *CustomerListResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CustomerListResponse.ProtoReflect.Descriptor instead. +func (*CustomerListResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{6} +} + +func (x *CustomerListResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CustomerListResponse) GetCustomers() []*Customer { + if x != nil { + return x.Customers + } + return nil +} + +func (x *CustomerListResponse) GetPage() *PageInfo { + if x != nil { + return x.Page + } + return nil +} + +type Project struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ProjectNo string `protobuf:"bytes,2,opt,name=project_no,json=projectNo,proto3" json:"project_no,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + HouseType string `protobuf:"bytes,5,opt,name=house_type,json=houseType,proto3" json:"house_type,omitempty"` + Province string `protobuf:"bytes,6,opt,name=province,proto3" json:"province,omitempty"` + ProvinceCode string `protobuf:"bytes,7,opt,name=province_code,json=provinceCode,proto3" json:"province_code,omitempty"` + City string `protobuf:"bytes,8,opt,name=city,proto3" json:"city,omitempty"` + CityCode string `protobuf:"bytes,9,opt,name=city_code,json=cityCode,proto3" json:"city_code,omitempty"` + District string `protobuf:"bytes,10,opt,name=district,proto3" json:"district,omitempty"` + DistrictCode string `protobuf:"bytes,11,opt,name=district_code,json=districtCode,proto3" json:"district_code,omitempty"` + Address string `protobuf:"bytes,12,opt,name=address,proto3" json:"address,omitempty"` + CustomerId uint64 `protobuf:"varint,16,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + CustomerName string `protobuf:"bytes,17,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"` + CustomerPhone string `protobuf:"bytes,18,opt,name=customer_phone,json=customerPhone,proto3" json:"customer_phone,omitempty"` + Remark string `protobuf:"bytes,19,opt,name=remark,proto3" json:"remark,omitempty"` + QuotationCount int32 `protobuf:"varint,20,opt,name=quotation_count,json=quotationCount,proto3" json:"quotation_count,omitempty"` + CreatedAt int64 `protobuf:"varint,21,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,22,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Project) Reset() { + *x = Project{} + mi := &file_shop_crm_agent_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Project) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Project) ProtoMessage() {} + +func (x *Project) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Project.ProtoReflect.Descriptor instead. +func (*Project) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{7} +} + +func (x *Project) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Project) GetProjectNo() string { + if x != nil { + return x.ProjectNo + } + return "" +} + +func (x *Project) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Project) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Project) GetHouseType() string { + if x != nil { + return x.HouseType + } + return "" +} + +func (x *Project) GetProvince() string { + if x != nil { + return x.Province + } + return "" +} + +func (x *Project) GetProvinceCode() string { + if x != nil { + return x.ProvinceCode + } + return "" +} + +func (x *Project) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *Project) GetCityCode() string { + if x != nil { + return x.CityCode + } + return "" +} + +func (x *Project) GetDistrict() string { + if x != nil { + return x.District + } + return "" +} + +func (x *Project) GetDistrictCode() string { + if x != nil { + return x.DistrictCode + } + return "" +} + +func (x *Project) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Project) GetCustomerId() uint64 { + if x != nil { + return x.CustomerId + } + return 0 +} + +func (x *Project) GetCustomerName() string { + if x != nil { + return x.CustomerName + } + return "" +} + +func (x *Project) GetCustomerPhone() string { + if x != nil { + return x.CustomerPhone + } + return "" +} + +func (x *Project) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *Project) GetQuotationCount() int32 { + if x != nil { + return x.QuotationCount + } + return 0 +} + +func (x *Project) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Project) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +type ProjectListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + HouseType string `protobuf:"bytes,3,opt,name=house_type,json=houseType,proto3" json:"house_type,omitempty"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectListRequest) Reset() { + *x = ProjectListRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectListRequest) ProtoMessage() {} + +func (x *ProjectListRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectListRequest.ProtoReflect.Descriptor instead. +func (*ProjectListRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{8} +} + +func (x *ProjectListRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *ProjectListRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ProjectListRequest) GetHouseType() string { + if x != nil { + return x.HouseType + } + return "" +} + +func (x *ProjectListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ProjectListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ProjectListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Projects []*Project `protobuf:"bytes,2,rep,name=projects,proto3" json:"projects,omitempty"` + Page *PageInfo `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectListResponse) Reset() { + *x = ProjectListResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectListResponse) ProtoMessage() {} + +func (x *ProjectListResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectListResponse.ProtoReflect.Descriptor instead. +func (*ProjectListResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{9} +} + +func (x *ProjectListResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *ProjectListResponse) GetProjects() []*Project { + if x != nil { + return x.Projects + } + return nil +} + +func (x *ProjectListResponse) GetPage() *PageInfo { + if x != nil { + return x.Page + } + return nil +} + +type ProjectGetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId uint64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectGetRequest) Reset() { + *x = ProjectGetRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectGetRequest) ProtoMessage() {} + +func (x *ProjectGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectGetRequest.ProtoReflect.Descriptor instead. +func (*ProjectGetRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{10} +} + +func (x *ProjectGetRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +type ProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Project *Project `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectResponse) Reset() { + *x = ProjectResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectResponse) ProtoMessage() {} + +func (x *ProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectResponse.ProtoReflect.Descriptor instead. +func (*ProjectResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{11} +} + +func (x *ProjectResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *ProjectResponse) GetProject() *Project { + if x != nil { + return x.Project + } + return nil +} + +type ProjectCreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CustomerId uint64 `protobuf:"varint,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` + HouseType string `protobuf:"bytes,4,opt,name=house_type,json=houseType,proto3" json:"house_type,omitempty"` + Province string `protobuf:"bytes,5,opt,name=province,proto3" json:"province,omitempty"` + ProvinceCode string `protobuf:"bytes,6,opt,name=province_code,json=provinceCode,proto3" json:"province_code,omitempty"` + City string `protobuf:"bytes,7,opt,name=city,proto3" json:"city,omitempty"` + CityCode string `protobuf:"bytes,8,opt,name=city_code,json=cityCode,proto3" json:"city_code,omitempty"` + District string `protobuf:"bytes,9,opt,name=district,proto3" json:"district,omitempty"` + DistrictCode string `protobuf:"bytes,10,opt,name=district_code,json=districtCode,proto3" json:"district_code,omitempty"` + Address string `protobuf:"bytes,11,opt,name=address,proto3" json:"address,omitempty"` + Remark string `protobuf:"bytes,13,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectCreateRequest) Reset() { + *x = ProjectCreateRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectCreateRequest) ProtoMessage() {} + +func (x *ProjectCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectCreateRequest.ProtoReflect.Descriptor instead. +func (*ProjectCreateRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{12} +} + +func (x *ProjectCreateRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *ProjectCreateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProjectCreateRequest) GetCustomerId() uint64 { + if x != nil { + return x.CustomerId + } + return 0 +} + +func (x *ProjectCreateRequest) GetHouseType() string { + if x != nil { + return x.HouseType + } + return "" +} + +func (x *ProjectCreateRequest) GetProvince() string { + if x != nil { + return x.Province + } + return "" +} + +func (x *ProjectCreateRequest) GetProvinceCode() string { + if x != nil { + return x.ProvinceCode + } + return "" +} + +func (x *ProjectCreateRequest) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *ProjectCreateRequest) GetCityCode() string { + if x != nil { + return x.CityCode + } + return "" +} + +func (x *ProjectCreateRequest) GetDistrict() string { + if x != nil { + return x.District + } + return "" +} + +func (x *ProjectCreateRequest) GetDistrictCode() string { + if x != nil { + return x.DistrictCode + } + return "" +} + +func (x *ProjectCreateRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ProjectCreateRequest) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type ProjectUpdateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + ProjectId uint64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Name *string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` + HouseType *string `protobuf:"bytes,4,opt,name=house_type,json=houseType,proto3,oneof" json:"house_type,omitempty"` + Province *string `protobuf:"bytes,5,opt,name=province,proto3,oneof" json:"province,omitempty"` + ProvinceCode *string `protobuf:"bytes,6,opt,name=province_code,json=provinceCode,proto3,oneof" json:"province_code,omitempty"` + City *string `protobuf:"bytes,7,opt,name=city,proto3,oneof" json:"city,omitempty"` + CityCode *string `protobuf:"bytes,8,opt,name=city_code,json=cityCode,proto3,oneof" json:"city_code,omitempty"` + District *string `protobuf:"bytes,9,opt,name=district,proto3,oneof" json:"district,omitempty"` + DistrictCode *string `protobuf:"bytes,10,opt,name=district_code,json=districtCode,proto3,oneof" json:"district_code,omitempty"` + Address *string `protobuf:"bytes,11,opt,name=address,proto3,oneof" json:"address,omitempty"` + Remark *string `protobuf:"bytes,13,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectUpdateRequest) Reset() { + *x = ProjectUpdateRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectUpdateRequest) ProtoMessage() {} + +func (x *ProjectUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectUpdateRequest.ProtoReflect.Descriptor instead. +func (*ProjectUpdateRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{13} +} + +func (x *ProjectUpdateRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *ProjectUpdateRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ProjectUpdateRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *ProjectUpdateRequest) GetHouseType() string { + if x != nil && x.HouseType != nil { + return *x.HouseType + } + return "" +} + +func (x *ProjectUpdateRequest) GetProvince() string { + if x != nil && x.Province != nil { + return *x.Province + } + return "" +} + +func (x *ProjectUpdateRequest) GetProvinceCode() string { + if x != nil && x.ProvinceCode != nil { + return *x.ProvinceCode + } + return "" +} + +func (x *ProjectUpdateRequest) GetCity() string { + if x != nil && x.City != nil { + return *x.City + } + return "" +} + +func (x *ProjectUpdateRequest) GetCityCode() string { + if x != nil && x.CityCode != nil { + return *x.CityCode + } + return "" +} + +func (x *ProjectUpdateRequest) GetDistrict() string { + if x != nil && x.District != nil { + return *x.District + } + return "" +} + +func (x *ProjectUpdateRequest) GetDistrictCode() string { + if x != nil && x.DistrictCode != nil { + return *x.DistrictCode + } + return "" +} + +func (x *ProjectUpdateRequest) GetAddress() string { + if x != nil && x.Address != nil { + return *x.Address + } + return "" +} + +func (x *ProjectUpdateRequest) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +type ProjectStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + ProjectId uint64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectStatusRequest) Reset() { + *x = ProjectStatusRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectStatusRequest) ProtoMessage() {} + +func (x *ProjectStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectStatusRequest.ProtoReflect.Descriptor instead. +func (*ProjectStatusRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{14} +} + +func (x *ProjectStatusRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *ProjectStatusRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ProjectStatusRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type ProjectDeletePreviewRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId uint64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectDeletePreviewRequest) Reset() { + *x = ProjectDeletePreviewRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectDeletePreviewRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectDeletePreviewRequest) ProtoMessage() {} + +func (x *ProjectDeletePreviewRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectDeletePreviewRequest.ProtoReflect.Descriptor instead. +func (*ProjectDeletePreviewRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{15} +} + +func (x *ProjectDeletePreviewRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +type DeletePreview struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + ResourceId uint64 `protobuf:"varint,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + Revision int32 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` + ChangeSetId string `protobuf:"bytes,4,opt,name=change_set_id,json=changeSetId,proto3" json:"change_set_id,omitempty"` + Allowed bool `protobuf:"varint,5,opt,name=allowed,proto3" json:"allowed,omitempty"` + Reasons []string `protobuf:"bytes,6,rep,name=reasons,proto3" json:"reasons,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeletePreview) Reset() { + *x = DeletePreview{} + mi := &file_shop_crm_agent_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeletePreview) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePreview) ProtoMessage() {} + +func (x *DeletePreview) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePreview.ProtoReflect.Descriptor instead. +func (*DeletePreview) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{16} +} + +func (x *DeletePreview) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *DeletePreview) GetResourceId() uint64 { + if x != nil { + return x.ResourceId + } + return 0 +} + +func (x *DeletePreview) GetRevision() int32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *DeletePreview) GetChangeSetId() string { + if x != nil { + return x.ChangeSetId + } + return "" +} + +func (x *DeletePreview) GetAllowed() bool { + if x != nil { + return x.Allowed + } + return false +} + +func (x *DeletePreview) GetReasons() []string { + if x != nil { + return x.Reasons + } + return nil +} + +type DeletePreviewResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Preview *DeletePreview `protobuf:"bytes,2,opt,name=preview,proto3" json:"preview,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeletePreviewResponse) Reset() { + *x = DeletePreviewResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeletePreviewResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePreviewResponse) ProtoMessage() {} + +func (x *DeletePreviewResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePreviewResponse.ProtoReflect.Descriptor instead. +func (*DeletePreviewResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{17} +} + +func (x *DeletePreviewResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *DeletePreviewResponse) GetPreview() *DeletePreview { + if x != nil { + return x.Preview + } + return nil +} + +type ProjectDeleteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + ProjectId uint64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ChangeSetId string `protobuf:"bytes,3,opt,name=change_set_id,json=changeSetId,proto3" json:"change_set_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectDeleteRequest) Reset() { + *x = ProjectDeleteRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectDeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectDeleteRequest) ProtoMessage() {} + +func (x *ProjectDeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectDeleteRequest.ProtoReflect.Descriptor instead. +func (*ProjectDeleteRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{18} +} + +func (x *ProjectDeleteRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *ProjectDeleteRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ProjectDeleteRequest) GetChangeSetId() string { + if x != nil { + return x.ChangeSetId + } + return "" +} + +type QuotationSummary struct { + state protoimpl.MessageState `protogen:"open.v1"` + QuotationId uint64 `protobuf:"varint,1,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + ArtifactId uint64 `protobuf:"varint,2,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` + ProjectId uint64 `protobuf:"varint,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ProjectNo string `protobuf:"bytes,4,opt,name=project_no,json=projectNo,proto3" json:"project_no,omitempty"` + ProjectName string `protobuf:"bytes,5,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` + CustomerName string `protobuf:"bytes,6,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"` + Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` + Status string `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` + Revision int32 `protobuf:"varint,9,opt,name=revision,proto3" json:"revision,omitempty"` + Locked bool `protobuf:"varint,10,opt,name=locked,proto3" json:"locked,omitempty"` + FinalAmount int64 `protobuf:"varint,11,opt,name=final_amount,json=finalAmount,proto3" json:"final_amount,omitempty"` + ActualAmount int64 `protobuf:"varint,12,opt,name=actual_amount,json=actualAmount,proto3" json:"actual_amount,omitempty"` + ItemCount int32 `protobuf:"varint,13,opt,name=item_count,json=itemCount,proto3" json:"item_count,omitempty"` + HasPriceAdjustment bool `protobuf:"varint,14,opt,name=has_price_adjustment,json=hasPriceAdjustment,proto3" json:"has_price_adjustment,omitempty"` + CreatedAt int64 `protobuf:"varint,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,16,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationSummary) Reset() { + *x = QuotationSummary{} + mi := &file_shop_crm_agent_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationSummary) ProtoMessage() {} + +func (x *QuotationSummary) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationSummary.ProtoReflect.Descriptor instead. +func (*QuotationSummary) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{19} +} + +func (x *QuotationSummary) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *QuotationSummary) GetArtifactId() uint64 { + if x != nil { + return x.ArtifactId + } + return 0 +} + +func (x *QuotationSummary) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *QuotationSummary) GetProjectNo() string { + if x != nil { + return x.ProjectNo + } + return "" +} + +func (x *QuotationSummary) GetProjectName() string { + if x != nil { + return x.ProjectName + } + return "" +} + +func (x *QuotationSummary) GetCustomerName() string { + if x != nil { + return x.CustomerName + } + return "" +} + +func (x *QuotationSummary) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QuotationSummary) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *QuotationSummary) GetRevision() int32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *QuotationSummary) GetLocked() bool { + if x != nil { + return x.Locked + } + return false +} + +func (x *QuotationSummary) GetFinalAmount() int64 { + if x != nil { + return x.FinalAmount + } + return 0 +} + +func (x *QuotationSummary) GetActualAmount() int64 { + if x != nil { + return x.ActualAmount + } + return 0 +} + +func (x *QuotationSummary) GetItemCount() int32 { + if x != nil { + return x.ItemCount + } + return 0 +} + +func (x *QuotationSummary) GetHasPriceAdjustment() bool { + if x != nil { + return x.HasPriceAdjustment + } + return false +} + +func (x *QuotationSummary) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *QuotationSummary) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +type QuotationCategory struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + SourceKey string `protobuf:"bytes,4,opt,name=source_key,json=sourceKey,proto3" json:"source_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationCategory) Reset() { + *x = QuotationCategory{} + mi := &file_shop_crm_agent_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationCategory) ProtoMessage() {} + +func (x *QuotationCategory) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationCategory.ProtoReflect.Descriptor instead. +func (*QuotationCategory) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{20} +} + +func (x *QuotationCategory) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QuotationCategory) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QuotationCategory) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *QuotationCategory) GetSourceKey() string { + if x != nil { + return x.SourceKey + } + return "" +} + +type QuotationSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Categories []*QuotationCategory `protobuf:"bytes,3,rep,name=categories,proto3" json:"categories,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationSpace) Reset() { + *x = QuotationSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationSpace) ProtoMessage() {} + +func (x *QuotationSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationSpace.ProtoReflect.Descriptor instead. +func (*QuotationSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{21} +} + +func (x *QuotationSpace) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QuotationSpace) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QuotationSpace) GetCategories() []*QuotationCategory { + if x != nil { + return x.Categories + } + return nil +} + +type QuotationFloor struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Spaces []*QuotationSpace `protobuf:"bytes,3,rep,name=spaces,proto3" json:"spaces,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationFloor) Reset() { + *x = QuotationFloor{} + mi := &file_shop_crm_agent_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationFloor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationFloor) ProtoMessage() {} + +func (x *QuotationFloor) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationFloor.ProtoReflect.Descriptor instead. +func (*QuotationFloor) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{22} +} + +func (x *QuotationFloor) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QuotationFloor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QuotationFloor) GetSpaces() []*QuotationSpace { + if x != nil { + return x.Spaces + } + return nil +} + +type QuotationLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + FloorId string `protobuf:"bytes,2,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + SpaceId string `protobuf:"bytes,3,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + CategoryId string `protobuf:"bytes,4,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + SourceType string `protobuf:"bytes,5,opt,name=source_type,json=sourceType,proto3" json:"source_type,omitempty"` + ProductId uint64 `protobuf:"varint,6,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + SkuId uint64 `protobuf:"varint,7,opt,name=sku_id,json=skuId,proto3" json:"sku_id,omitempty"` + GoodsName string `protobuf:"bytes,8,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty"` + SpecCombination string `protobuf:"bytes,9,opt,name=spec_combination,json=specCombination,proto3" json:"spec_combination,omitempty"` + ImageId uint64 `protobuf:"varint,10,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + ImageUrl string `protobuf:"bytes,11,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + CategoryName string `protobuf:"bytes,12,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + SortOrder int32 `protobuf:"varint,13,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + Remark string `protobuf:"bytes,14,opt,name=remark,proto3" json:"remark,omitempty"` + Active bool `protobuf:"varint,15,opt,name=active,proto3" json:"active,omitempty"` + UnitPrice int64 `protobuf:"varint,16,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"` + Quantity float64 `protobuf:"fixed64,17,opt,name=quantity,proto3" json:"quantity,omitempty"` + DiscountRate int32 `protobuf:"varint,18,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` + DiscountAmount int64 `protobuf:"varint,19,opt,name=discount_amount,json=discountAmount,proto3" json:"discount_amount,omitempty"` + CostPrice int64 `protobuf:"varint,20,opt,name=cost_price,json=costPrice,proto3" json:"cost_price,omitempty"` + OriginalSubtotal int64 `protobuf:"varint,21,opt,name=original_subtotal,json=originalSubtotal,proto3" json:"original_subtotal,omitempty"` + DiscountedSubtotal int64 `protobuf:"varint,22,opt,name=discounted_subtotal,json=discountedSubtotal,proto3" json:"discounted_subtotal,omitempty"` + FinalSubtotal int64 `protobuf:"varint,23,opt,name=final_subtotal,json=finalSubtotal,proto3" json:"final_subtotal,omitempty"` + CostSubtotal int64 `protobuf:"varint,24,opt,name=cost_subtotal,json=costSubtotal,proto3" json:"cost_subtotal,omitempty"` + ProfitSubtotal int64 `protobuf:"varint,25,opt,name=profit_subtotal,json=profitSubtotal,proto3" json:"profit_subtotal,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationLine) Reset() { + *x = QuotationLine{} + mi := &file_shop_crm_agent_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationLine) ProtoMessage() {} + +func (x *QuotationLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationLine.ProtoReflect.Descriptor instead. +func (*QuotationLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{23} +} + +func (x *QuotationLine) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +func (x *QuotationLine) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *QuotationLine) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *QuotationLine) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *QuotationLine) GetSourceType() string { + if x != nil { + return x.SourceType + } + return "" +} + +func (x *QuotationLine) GetProductId() uint64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *QuotationLine) GetSkuId() uint64 { + if x != nil { + return x.SkuId + } + return 0 +} + +func (x *QuotationLine) GetGoodsName() string { + if x != nil { + return x.GoodsName + } + return "" +} + +func (x *QuotationLine) GetSpecCombination() string { + if x != nil { + return x.SpecCombination + } + return "" +} + +func (x *QuotationLine) GetImageId() uint64 { + if x != nil { + return x.ImageId + } + return 0 +} + +func (x *QuotationLine) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +func (x *QuotationLine) GetCategoryName() string { + if x != nil { + return x.CategoryName + } + return "" +} + +func (x *QuotationLine) GetSortOrder() int32 { + if x != nil { + return x.SortOrder + } + return 0 +} + +func (x *QuotationLine) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *QuotationLine) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +func (x *QuotationLine) GetUnitPrice() int64 { + if x != nil { + return x.UnitPrice + } + return 0 +} + +func (x *QuotationLine) GetQuantity() float64 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *QuotationLine) GetDiscountRate() int32 { + if x != nil { + return x.DiscountRate + } + return 0 +} + +func (x *QuotationLine) GetDiscountAmount() int64 { + if x != nil { + return x.DiscountAmount + } + return 0 +} + +func (x *QuotationLine) GetCostPrice() int64 { + if x != nil { + return x.CostPrice + } + return 0 +} + +func (x *QuotationLine) GetOriginalSubtotal() int64 { + if x != nil { + return x.OriginalSubtotal + } + return 0 +} + +func (x *QuotationLine) GetDiscountedSubtotal() int64 { + if x != nil { + return x.DiscountedSubtotal + } + return 0 +} + +func (x *QuotationLine) GetFinalSubtotal() int64 { + if x != nil { + return x.FinalSubtotal + } + return 0 +} + +func (x *QuotationLine) GetCostSubtotal() int64 { + if x != nil { + return x.CostSubtotal + } + return 0 +} + +func (x *QuotationLine) GetProfitSubtotal() int64 { + if x != nil { + return x.ProfitSubtotal + } + return 0 +} + +type QuotationFee struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + FixedAmount int64 `protobuf:"varint,4,opt,name=fixed_amount,json=fixedAmount,proto3" json:"fixed_amount,omitempty"` + Percentage int32 `protobuf:"varint,5,opt,name=percentage,proto3" json:"percentage,omitempty"` + SortOrder int32 `protobuf:"varint,6,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"` + Amount int64 `protobuf:"varint,8,opt,name=amount,proto3" json:"amount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationFee) Reset() { + *x = QuotationFee{} + mi := &file_shop_crm_agent_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationFee) ProtoMessage() {} + +func (x *QuotationFee) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationFee.ProtoReflect.Descriptor instead. +func (*QuotationFee) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{24} +} + +func (x *QuotationFee) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *QuotationFee) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QuotationFee) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *QuotationFee) GetFixedAmount() int64 { + if x != nil { + return x.FixedAmount + } + return 0 +} + +func (x *QuotationFee) GetPercentage() int32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *QuotationFee) GetSortOrder() int32 { + if x != nil { + return x.SortOrder + } + return 0 +} + +func (x *QuotationFee) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *QuotationFee) GetAmount() int64 { + if x != nil { + return x.Amount + } + return 0 +} + +type Quotation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Summary *QuotationSummary `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` + Floors []*QuotationFloor `protobuf:"bytes,2,rep,name=floors,proto3" json:"floors,omitempty"` + Lines []*QuotationLine `protobuf:"bytes,3,rep,name=lines,proto3" json:"lines,omitempty"` + Fees []*QuotationFee `protobuf:"bytes,4,rep,name=fees,proto3" json:"fees,omitempty"` + DiscountRate int32 `protobuf:"varint,5,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` + DiscountAmount int64 `protobuf:"varint,6,opt,name=discount_amount,json=discountAmount,proto3" json:"discount_amount,omitempty"` + OriginalTotalAmount int64 `protobuf:"varint,7,opt,name=original_total_amount,json=originalTotalAmount,proto3" json:"original_total_amount,omitempty"` + TotalAmount int64 `protobuf:"varint,8,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount,omitempty"` + DiscountedAmount int64 `protobuf:"varint,9,opt,name=discounted_amount,json=discountedAmount,proto3" json:"discounted_amount,omitempty"` + TotalFeeAmount int64 `protobuf:"varint,10,opt,name=total_fee_amount,json=totalFeeAmount,proto3" json:"total_fee_amount,omitempty"` + FinalAmount int64 `protobuf:"varint,11,opt,name=final_amount,json=finalAmount,proto3" json:"final_amount,omitempty"` + ActualAmount int64 `protobuf:"varint,12,opt,name=actual_amount,json=actualAmount,proto3" json:"actual_amount,omitempty"` + HasPriceAdjustment bool `protobuf:"varint,13,opt,name=has_price_adjustment,json=hasPriceAdjustment,proto3" json:"has_price_adjustment,omitempty"` + TotalCost int64 `protobuf:"varint,14,opt,name=total_cost,json=totalCost,proto3" json:"total_cost,omitempty"` + ProductProfit int64 `protobuf:"varint,15,opt,name=product_profit,json=productProfit,proto3" json:"product_profit,omitempty"` + TotalProfit int64 `protobuf:"varint,16,opt,name=total_profit,json=totalProfit,proto3" json:"total_profit,omitempty"` + ProductProfitRate float64 `protobuf:"fixed64,17,opt,name=product_profit_rate,json=productProfitRate,proto3" json:"product_profit_rate,omitempty"` + TotalProfitRate float64 `protobuf:"fixed64,18,opt,name=total_profit_rate,json=totalProfitRate,proto3" json:"total_profit_rate,omitempty"` + Remark string `protobuf:"bytes,19,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Quotation) Reset() { + *x = Quotation{} + mi := &file_shop_crm_agent_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Quotation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Quotation) ProtoMessage() {} + +func (x *Quotation) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Quotation.ProtoReflect.Descriptor instead. +func (*Quotation) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{25} +} + +func (x *Quotation) GetSummary() *QuotationSummary { + if x != nil { + return x.Summary + } + return nil +} + +func (x *Quotation) GetFloors() []*QuotationFloor { + if x != nil { + return x.Floors + } + return nil +} + +func (x *Quotation) GetLines() []*QuotationLine { + if x != nil { + return x.Lines + } + return nil +} + +func (x *Quotation) GetFees() []*QuotationFee { + if x != nil { + return x.Fees + } + return nil +} + +func (x *Quotation) GetDiscountRate() int32 { + if x != nil { + return x.DiscountRate + } + return 0 +} + +func (x *Quotation) GetDiscountAmount() int64 { + if x != nil { + return x.DiscountAmount + } + return 0 +} + +func (x *Quotation) GetOriginalTotalAmount() int64 { + if x != nil { + return x.OriginalTotalAmount + } + return 0 +} + +func (x *Quotation) GetTotalAmount() int64 { + if x != nil { + return x.TotalAmount + } + return 0 +} + +func (x *Quotation) GetDiscountedAmount() int64 { + if x != nil { + return x.DiscountedAmount + } + return 0 +} + +func (x *Quotation) GetTotalFeeAmount() int64 { + if x != nil { + return x.TotalFeeAmount + } + return 0 +} + +func (x *Quotation) GetFinalAmount() int64 { + if x != nil { + return x.FinalAmount + } + return 0 +} + +func (x *Quotation) GetActualAmount() int64 { + if x != nil { + return x.ActualAmount + } + return 0 +} + +func (x *Quotation) GetHasPriceAdjustment() bool { + if x != nil { + return x.HasPriceAdjustment + } + return false +} + +func (x *Quotation) GetTotalCost() int64 { + if x != nil { + return x.TotalCost + } + return 0 +} + +func (x *Quotation) GetProductProfit() int64 { + if x != nil { + return x.ProductProfit + } + return 0 +} + +func (x *Quotation) GetTotalProfit() int64 { + if x != nil { + return x.TotalProfit + } + return 0 +} + +func (x *Quotation) GetProductProfitRate() float64 { + if x != nil { + return x.ProductProfitRate + } + return 0 +} + +func (x *Quotation) GetTotalProfitRate() float64 { + if x != nil { + return x.TotalProfitRate + } + return 0 +} + +func (x *Quotation) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type QuotationListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId uint64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Keyword string `protobuf:"bytes,2,opt,name=keyword,proto3" json:"keyword,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationListRequest) Reset() { + *x = QuotationListRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationListRequest) ProtoMessage() {} + +func (x *QuotationListRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationListRequest.ProtoReflect.Descriptor instead. +func (*QuotationListRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{26} +} + +func (x *QuotationListRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *QuotationListRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *QuotationListRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *QuotationListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *QuotationListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QuotationListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Quotations []*QuotationSummary `protobuf:"bytes,2,rep,name=quotations,proto3" json:"quotations,omitempty"` + Page *PageInfo `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationListResponse) Reset() { + *x = QuotationListResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationListResponse) ProtoMessage() {} + +func (x *QuotationListResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationListResponse.ProtoReflect.Descriptor instead. +func (*QuotationListResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{27} +} + +func (x *QuotationListResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *QuotationListResponse) GetQuotations() []*QuotationSummary { + if x != nil { + return x.Quotations + } + return nil +} + +func (x *QuotationListResponse) GetPage() *PageInfo { + if x != nil { + return x.Page + } + return nil +} + +type QuotationGetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + QuotationId uint64 `protobuf:"varint,1,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationGetRequest) Reset() { + *x = QuotationGetRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationGetRequest) ProtoMessage() {} + +func (x *QuotationGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationGetRequest.ProtoReflect.Descriptor instead. +func (*QuotationGetRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{28} +} + +func (x *QuotationGetRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +type QuotationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Quotation *Quotation `protobuf:"bytes,2,opt,name=quotation,proto3" json:"quotation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationResponse) Reset() { + *x = QuotationResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationResponse) ProtoMessage() {} + +func (x *QuotationResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationResponse.ProtoReflect.Descriptor instead. +func (*QuotationResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{29} +} + +func (x *QuotationResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *QuotationResponse) GetQuotation() *Quotation { + if x != nil { + return x.Quotation + } + return nil +} + +type QuotationCreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + ProjectId uint64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationCreateRequest) Reset() { + *x = QuotationCreateRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationCreateRequest) ProtoMessage() {} + +func (x *QuotationCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationCreateRequest.ProtoReflect.Descriptor instead. +func (*QuotationCreateRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{30} +} + +func (x *QuotationCreateRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationCreateRequest) GetProjectId() uint64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *QuotationCreateRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type QuotationCopyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationCopyRequest) Reset() { + *x = QuotationCopyRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationCopyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationCopyRequest) ProtoMessage() {} + +func (x *QuotationCopyRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationCopyRequest.ProtoReflect.Descriptor instead. +func (*QuotationCopyRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{31} +} + +func (x *QuotationCopyRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationCopyRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *QuotationCopyRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type QuotationTitleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationTitleRequest) Reset() { + *x = QuotationTitleRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationTitleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationTitleRequest) ProtoMessage() {} + +func (x *QuotationTitleRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationTitleRequest.ProtoReflect.Descriptor instead. +func (*QuotationTitleRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{32} +} + +func (x *QuotationTitleRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationTitleRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *QuotationTitleRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type QuotationStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationStatusRequest) Reset() { + *x = QuotationStatusRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationStatusRequest) ProtoMessage() {} + +func (x *QuotationStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationStatusRequest.ProtoReflect.Descriptor instead. +func (*QuotationStatusRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{33} +} + +func (x *QuotationStatusRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationStatusRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *QuotationStatusRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type QuotationLockRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationLockRequest) Reset() { + *x = QuotationLockRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationLockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationLockRequest) ProtoMessage() {} + +func (x *QuotationLockRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationLockRequest.ProtoReflect.Descriptor instead. +func (*QuotationLockRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{34} +} + +func (x *QuotationLockRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationLockRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +type QuotationDeletePreviewRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + QuotationId uint64 `protobuf:"varint,1,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationDeletePreviewRequest) Reset() { + *x = QuotationDeletePreviewRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationDeletePreviewRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationDeletePreviewRequest) ProtoMessage() {} + +func (x *QuotationDeletePreviewRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationDeletePreviewRequest.ProtoReflect.Descriptor instead. +func (*QuotationDeletePreviewRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{35} +} + +func (x *QuotationDeletePreviewRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +type QuotationDeleteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + Revision int32 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` + ChangeSetId string `protobuf:"bytes,4,opt,name=change_set_id,json=changeSetId,proto3" json:"change_set_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationDeleteRequest) Reset() { + *x = QuotationDeleteRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationDeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationDeleteRequest) ProtoMessage() {} + +func (x *QuotationDeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationDeleteRequest.ProtoReflect.Descriptor instead. +func (*QuotationDeleteRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{36} +} + +func (x *QuotationDeleteRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationDeleteRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *QuotationDeleteRequest) GetRevision() int32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *QuotationDeleteRequest) GetChangeSetId() string { + if x != nil { + return x.ChangeSetId + } + return "" +} + +type CatalogSku struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ProductId uint64 `protobuf:"varint,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + SkuCode string `protobuf:"bytes,3,opt,name=sku_code,json=skuCode,proto3" json:"sku_code,omitempty"` + SkuName string `protobuf:"bytes,4,opt,name=sku_name,json=skuName,proto3" json:"sku_name,omitempty"` + ProductName string `protobuf:"bytes,5,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + QuotationName string `protobuf:"bytes,6,opt,name=quotation_name,json=quotationName,proto3" json:"quotation_name,omitempty"` + CategoryName string `protobuf:"bytes,7,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + SpecCombination string `protobuf:"bytes,8,opt,name=spec_combination,json=specCombination,proto3" json:"spec_combination,omitempty"` + PriceCents int64 `protobuf:"varint,9,opt,name=price_cents,json=priceCents,proto3" json:"price_cents,omitempty"` + CostPriceCents int64 `protobuf:"varint,10,opt,name=cost_price_cents,json=costPriceCents,proto3" json:"cost_price_cents,omitempty"` + ImageId uint64 `protobuf:"varint,11,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + ImageUrl string `protobuf:"bytes,12,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CatalogSku) Reset() { + *x = CatalogSku{} + mi := &file_shop_crm_agent_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CatalogSku) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CatalogSku) ProtoMessage() {} + +func (x *CatalogSku) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CatalogSku.ProtoReflect.Descriptor instead. +func (*CatalogSku) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{37} +} + +func (x *CatalogSku) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CatalogSku) GetProductId() uint64 { + if x != nil { + return x.ProductId + } + return 0 +} + +func (x *CatalogSku) GetSkuCode() string { + if x != nil { + return x.SkuCode + } + return "" +} + +func (x *CatalogSku) GetSkuName() string { + if x != nil { + return x.SkuName + } + return "" +} + +func (x *CatalogSku) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *CatalogSku) GetQuotationName() string { + if x != nil { + return x.QuotationName + } + return "" +} + +func (x *CatalogSku) GetCategoryName() string { + if x != nil { + return x.CategoryName + } + return "" +} + +func (x *CatalogSku) GetSpecCombination() string { + if x != nil { + return x.SpecCombination + } + return "" +} + +func (x *CatalogSku) GetPriceCents() int64 { + if x != nil { + return x.PriceCents + } + return 0 +} + +func (x *CatalogSku) GetCostPriceCents() int64 { + if x != nil { + return x.CostPriceCents + } + return 0 +} + +func (x *CatalogSku) GetImageId() uint64 { + if x != nil { + return x.ImageId + } + return 0 +} + +func (x *CatalogSku) GetImageUrl() string { + if x != nil { + return x.ImageUrl + } + return "" +} + +type CatalogProduct struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + QuotationName string `protobuf:"bytes,3,opt,name=quotation_name,json=quotationName,proto3" json:"quotation_name,omitempty"` + CategoryName string `protobuf:"bytes,4,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + RootCategoryId uint64 `protobuf:"varint,5,opt,name=root_category_id,json=rootCategoryId,proto3" json:"root_category_id,omitempty"` + RootCategoryName string `protobuf:"bytes,6,opt,name=root_category_name,json=rootCategoryName,proto3" json:"root_category_name,omitempty"` + Skus []*CatalogSku `protobuf:"bytes,7,rep,name=skus,proto3" json:"skus,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CatalogProduct) Reset() { + *x = CatalogProduct{} + mi := &file_shop_crm_agent_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CatalogProduct) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CatalogProduct) ProtoMessage() {} + +func (x *CatalogProduct) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CatalogProduct.ProtoReflect.Descriptor instead. +func (*CatalogProduct) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{38} +} + +func (x *CatalogProduct) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CatalogProduct) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CatalogProduct) GetQuotationName() string { + if x != nil { + return x.QuotationName + } + return "" +} + +func (x *CatalogProduct) GetCategoryName() string { + if x != nil { + return x.CategoryName + } + return "" +} + +func (x *CatalogProduct) GetRootCategoryId() uint64 { + if x != nil { + return x.RootCategoryId + } + return 0 +} + +func (x *CatalogProduct) GetRootCategoryName() string { + if x != nil { + return x.RootCategoryName + } + return "" +} + +func (x *CatalogProduct) GetSkus() []*CatalogSku { + if x != nil { + return x.Skus + } + return nil +} + +type CatalogSearchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` + CategoryId uint64 `protobuf:"varint,2,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + RootCategoryId uint64 `protobuf:"varint,3,opt,name=root_category_id,json=rootCategoryId,proto3" json:"root_category_id,omitempty"` + BrandId uint64 `protobuf:"varint,4,opt,name=brand_id,json=brandId,proto3" json:"brand_id,omitempty"` + Page int32 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,6,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CatalogSearchRequest) Reset() { + *x = CatalogSearchRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CatalogSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CatalogSearchRequest) ProtoMessage() {} + +func (x *CatalogSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CatalogSearchRequest.ProtoReflect.Descriptor instead. +func (*CatalogSearchRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{39} +} + +func (x *CatalogSearchRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +func (x *CatalogSearchRequest) GetCategoryId() uint64 { + if x != nil { + return x.CategoryId + } + return 0 +} + +func (x *CatalogSearchRequest) GetRootCategoryId() uint64 { + if x != nil { + return x.RootCategoryId + } + return 0 +} + +func (x *CatalogSearchRequest) GetBrandId() uint64 { + if x != nil { + return x.BrandId + } + return 0 +} + +func (x *CatalogSearchRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *CatalogSearchRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type CatalogSearchResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Products []*CatalogProduct `protobuf:"bytes,2,rep,name=products,proto3" json:"products,omitempty"` + Page *PageInfo `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CatalogSearchResponse) Reset() { + *x = CatalogSearchResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CatalogSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CatalogSearchResponse) ProtoMessage() {} + +func (x *CatalogSearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CatalogSearchResponse.ProtoReflect.Descriptor instead. +func (*CatalogSearchResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{40} +} + +func (x *CatalogSearchResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CatalogSearchResponse) GetProducts() []*CatalogProduct { + if x != nil { + return x.Products + } + return nil +} + +func (x *CatalogSearchResponse) GetPage() *PageInfo { + if x != nil { + return x.Page + } + return nil +} + +type EditSession struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + ArtifactId uint64 `protobuf:"varint,3,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` + BaseRevision int32 `protobuf:"varint,4,opt,name=base_revision,json=baseRevision,proto3" json:"base_revision,omitempty"` + ExpiresAt int64 `protobuf:"varint,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + Quotation *Quotation `protobuf:"bytes,6,opt,name=quotation,proto3" json:"quotation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EditSession) Reset() { + *x = EditSession{} + mi := &file_shop_crm_agent_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EditSession) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditSession) ProtoMessage() {} + +func (x *EditSession) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditSession.ProtoReflect.Descriptor instead. +func (*EditSession) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{41} +} + +func (x *EditSession) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *EditSession) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +func (x *EditSession) GetArtifactId() uint64 { + if x != nil { + return x.ArtifactId + } + return 0 +} + +func (x *EditSession) GetBaseRevision() int32 { + if x != nil { + return x.BaseRevision + } + return 0 +} + +func (x *EditSession) GetExpiresAt() int64 { + if x != nil { + return x.ExpiresAt + } + return 0 +} + +func (x *EditSession) GetQuotation() *Quotation { + if x != nil { + return x.Quotation + } + return nil +} + +type QuotationEditBeginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + QuotationId uint64 `protobuf:"varint,2,opt,name=quotation_id,json=quotationId,proto3" json:"quotation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditBeginRequest) Reset() { + *x = QuotationEditBeginRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditBeginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditBeginRequest) ProtoMessage() {} + +func (x *QuotationEditBeginRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditBeginRequest.ProtoReflect.Descriptor instead. +func (*QuotationEditBeginRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{42} +} + +func (x *QuotationEditBeginRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationEditBeginRequest) GetQuotationId() uint64 { + if x != nil { + return x.QuotationId + } + return 0 +} + +type EditSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Session *EditSession `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EditSessionResponse) Reset() { + *x = EditSessionResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EditSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditSessionResponse) ProtoMessage() {} + +func (x *EditSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditSessionResponse.ProtoReflect.Descriptor instead. +func (*EditSessionResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{43} +} + +func (x *EditSessionResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *EditSessionResponse) GetSession() *EditSession { + if x != nil { + return x.Session + } + return nil +} + +type AddFloor struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Index int32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddFloor) Reset() { + *x = AddFloor{} + mi := &file_shop_crm_agent_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddFloor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddFloor) ProtoMessage() {} + +func (x *AddFloor) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddFloor.ProtoReflect.Descriptor instead. +func (*AddFloor) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{44} +} + +func (x *AddFloor) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AddFloor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddFloor) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RenameFloor struct { + state protoimpl.MessageState `protogen:"open.v1"` + FloorId string `protobuf:"bytes,1,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenameFloor) Reset() { + *x = RenameFloor{} + mi := &file_shop_crm_agent_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenameFloor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameFloor) ProtoMessage() {} + +func (x *RenameFloor) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenameFloor.ProtoReflect.Descriptor instead. +func (*RenameFloor) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{45} +} + +func (x *RenameFloor) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *RenameFloor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ReorderFloor struct { + state protoimpl.MessageState `protogen:"open.v1"` + FloorId string `protobuf:"bytes,1,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReorderFloor) Reset() { + *x = ReorderFloor{} + mi := &file_shop_crm_agent_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReorderFloor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderFloor) ProtoMessage() {} + +func (x *ReorderFloor) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReorderFloor.ProtoReflect.Descriptor instead. +func (*ReorderFloor) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{46} +} + +func (x *ReorderFloor) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *ReorderFloor) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RemoveFloor struct { + state protoimpl.MessageState `protogen:"open.v1"` + FloorId string `protobuf:"bytes,1,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + Cascade bool `protobuf:"varint,2,opt,name=cascade,proto3" json:"cascade,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveFloor) Reset() { + *x = RemoveFloor{} + mi := &file_shop_crm_agent_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveFloor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveFloor) ProtoMessage() {} + +func (x *RemoveFloor) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveFloor.ProtoReflect.Descriptor instead. +func (*RemoveFloor) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{47} +} + +func (x *RemoveFloor) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *RemoveFloor) GetCascade() bool { + if x != nil { + return x.Cascade + } + return false +} + +type AddSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + FloorId string `protobuf:"bytes,2,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Index int32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddSpace) Reset() { + *x = AddSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddSpace) ProtoMessage() {} + +func (x *AddSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddSpace.ProtoReflect.Descriptor instead. +func (*AddSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{48} +} + +func (x *AddSpace) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AddSpace) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *AddSpace) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddSpace) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RenameSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenameSpace) Reset() { + *x = RenameSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenameSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameSpace) ProtoMessage() {} + +func (x *RenameSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenameSpace.ProtoReflect.Descriptor instead. +func (*RenameSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{49} +} + +func (x *RenameSpace) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *RenameSpace) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type MoveSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + TargetFloorId string `protobuf:"bytes,2,opt,name=target_floor_id,json=targetFloorId,proto3" json:"target_floor_id,omitempty"` + Index int32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MoveSpace) Reset() { + *x = MoveSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MoveSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveSpace) ProtoMessage() {} + +func (x *MoveSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MoveSpace.ProtoReflect.Descriptor instead. +func (*MoveSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{50} +} + +func (x *MoveSpace) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *MoveSpace) GetTargetFloorId() string { + if x != nil { + return x.TargetFloorId + } + return "" +} + +func (x *MoveSpace) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type ReorderSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReorderSpace) Reset() { + *x = ReorderSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReorderSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderSpace) ProtoMessage() {} + +func (x *ReorderSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReorderSpace.ProtoReflect.Descriptor instead. +func (*ReorderSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{51} +} + +func (x *ReorderSpace) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *ReorderSpace) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RemoveSpace struct { + state protoimpl.MessageState `protogen:"open.v1"` + SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + Cascade bool `protobuf:"varint,2,opt,name=cascade,proto3" json:"cascade,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveSpace) Reset() { + *x = RemoveSpace{} + mi := &file_shop_crm_agent_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveSpace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveSpace) ProtoMessage() {} + +func (x *RemoveSpace) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveSpace.ProtoReflect.Descriptor instead. +func (*RemoveSpace) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{52} +} + +func (x *RemoveSpace) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *RemoveSpace) GetCascade() bool { + if x != nil { + return x.Cascade + } + return false +} + +type AddCategory struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + FloorId string `protobuf:"bytes,2,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + SpaceId string `protobuf:"bytes,3,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + SourceKey string `protobuf:"bytes,6,opt,name=source_key,json=sourceKey,proto3" json:"source_key,omitempty"` + Index int32 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddCategory) Reset() { + *x = AddCategory{} + mi := &file_shop_crm_agent_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCategory) ProtoMessage() {} + +func (x *AddCategory) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCategory.ProtoReflect.Descriptor instead. +func (*AddCategory) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{53} +} + +func (x *AddCategory) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AddCategory) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *AddCategory) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *AddCategory) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddCategory) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *AddCategory) GetSourceKey() string { + if x != nil { + return x.SourceKey + } + return "" +} + +func (x *AddCategory) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RenameCategory struct { + state protoimpl.MessageState `protogen:"open.v1"` + CategoryId string `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenameCategory) Reset() { + *x = RenameCategory{} + mi := &file_shop_crm_agent_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenameCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameCategory) ProtoMessage() {} + +func (x *RenameCategory) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenameCategory.ProtoReflect.Descriptor instead. +func (*RenameCategory) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{54} +} + +func (x *RenameCategory) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *RenameCategory) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ReorderCategory struct { + state protoimpl.MessageState `protogen:"open.v1"` + CategoryId string `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReorderCategory) Reset() { + *x = ReorderCategory{} + mi := &file_shop_crm_agent_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReorderCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderCategory) ProtoMessage() {} + +func (x *ReorderCategory) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReorderCategory.ProtoReflect.Descriptor instead. +func (*ReorderCategory) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{55} +} + +func (x *ReorderCategory) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *ReorderCategory) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type RemoveCategory struct { + state protoimpl.MessageState `protogen:"open.v1"` + CategoryId string `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Cascade bool `protobuf:"varint,2,opt,name=cascade,proto3" json:"cascade,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveCategory) Reset() { + *x = RemoveCategory{} + mi := &file_shop_crm_agent_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveCategory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveCategory) ProtoMessage() {} + +func (x *RemoveCategory) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveCategory.ProtoReflect.Descriptor instead. +func (*RemoveCategory) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{56} +} + +func (x *RemoveCategory) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *RemoveCategory) GetCascade() bool { + if x != nil { + return x.Cascade + } + return false +} + +type AddCatalogLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + FloorId string `protobuf:"bytes,1,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + SpaceId string `protobuf:"bytes,2,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + CategoryId string `protobuf:"bytes,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + SkuId uint64 `protobuf:"varint,4,opt,name=sku_id,json=skuId,proto3" json:"sku_id,omitempty"` + Quantity float64 `protobuf:"fixed64,5,opt,name=quantity,proto3" json:"quantity,omitempty"` + DiscountRate int32 `protobuf:"varint,6,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` + DiscountAmount int64 `protobuf:"varint,7,opt,name=discount_amount,json=discountAmount,proto3" json:"discount_amount,omitempty"` + Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` + Index int32 `protobuf:"varint,9,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddCatalogLine) Reset() { + *x = AddCatalogLine{} + mi := &file_shop_crm_agent_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCatalogLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCatalogLine) ProtoMessage() {} + +func (x *AddCatalogLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCatalogLine.ProtoReflect.Descriptor instead. +func (*AddCatalogLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{57} +} + +func (x *AddCatalogLine) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *AddCatalogLine) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *AddCatalogLine) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *AddCatalogLine) GetSkuId() uint64 { + if x != nil { + return x.SkuId + } + return 0 +} + +func (x *AddCatalogLine) GetQuantity() float64 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *AddCatalogLine) GetDiscountRate() int32 { + if x != nil { + return x.DiscountRate + } + return 0 +} + +func (x *AddCatalogLine) GetDiscountAmount() int64 { + if x != nil { + return x.DiscountAmount + } + return 0 +} + +func (x *AddCatalogLine) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *AddCatalogLine) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type AddCustomLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + FloorId string `protobuf:"bytes,1,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + SpaceId string `protobuf:"bytes,2,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + CategoryId string `protobuf:"bytes,3,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + GoodsName string `protobuf:"bytes,4,opt,name=goods_name,json=goodsName,proto3" json:"goods_name,omitempty"` + SpecCombination string `protobuf:"bytes,5,opt,name=spec_combination,json=specCombination,proto3" json:"spec_combination,omitempty"` + Quantity float64 `protobuf:"fixed64,6,opt,name=quantity,proto3" json:"quantity,omitempty"` + UnitPrice int64 `protobuf:"varint,7,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"` + CostPrice int64 `protobuf:"varint,8,opt,name=cost_price,json=costPrice,proto3" json:"cost_price,omitempty"` + DiscountRate int32 `protobuf:"varint,9,opt,name=discount_rate,json=discountRate,proto3" json:"discount_rate,omitempty"` + DiscountAmount int64 `protobuf:"varint,10,opt,name=discount_amount,json=discountAmount,proto3" json:"discount_amount,omitempty"` + Remark string `protobuf:"bytes,11,opt,name=remark,proto3" json:"remark,omitempty"` + Index int32 `protobuf:"varint,12,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddCustomLine) Reset() { + *x = AddCustomLine{} + mi := &file_shop_crm_agent_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddCustomLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddCustomLine) ProtoMessage() {} + +func (x *AddCustomLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddCustomLine.ProtoReflect.Descriptor instead. +func (*AddCustomLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{58} +} + +func (x *AddCustomLine) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *AddCustomLine) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *AddCustomLine) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *AddCustomLine) GetGoodsName() string { + if x != nil { + return x.GoodsName + } + return "" +} + +func (x *AddCustomLine) GetSpecCombination() string { + if x != nil { + return x.SpecCombination + } + return "" +} + +func (x *AddCustomLine) GetQuantity() float64 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *AddCustomLine) GetUnitPrice() int64 { + if x != nil { + return x.UnitPrice + } + return 0 +} + +func (x *AddCustomLine) GetCostPrice() int64 { + if x != nil { + return x.CostPrice + } + return 0 +} + +func (x *AddCustomLine) GetDiscountRate() int32 { + if x != nil { + return x.DiscountRate + } + return 0 +} + +func (x *AddCustomLine) GetDiscountAmount() int64 { + if x != nil { + return x.DiscountAmount + } + return 0 +} + +func (x *AddCustomLine) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *AddCustomLine) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type UpdateLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + GoodsName *string `protobuf:"bytes,2,opt,name=goods_name,json=goodsName,proto3,oneof" json:"goods_name,omitempty"` + SpecCombination *string `protobuf:"bytes,3,opt,name=spec_combination,json=specCombination,proto3,oneof" json:"spec_combination,omitempty"` + Quantity *float64 `protobuf:"fixed64,4,opt,name=quantity,proto3,oneof" json:"quantity,omitempty"` + UnitPrice *int64 `protobuf:"varint,5,opt,name=unit_price,json=unitPrice,proto3,oneof" json:"unit_price,omitempty"` + CostPrice *int64 `protobuf:"varint,6,opt,name=cost_price,json=costPrice,proto3,oneof" json:"cost_price,omitempty"` + DiscountRate *int32 `protobuf:"varint,7,opt,name=discount_rate,json=discountRate,proto3,oneof" json:"discount_rate,omitempty"` + DiscountAmount *int64 `protobuf:"varint,8,opt,name=discount_amount,json=discountAmount,proto3,oneof" json:"discount_amount,omitempty"` + Remark *string `protobuf:"bytes,9,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateLine) Reset() { + *x = UpdateLine{} + mi := &file_shop_crm_agent_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLine) ProtoMessage() {} + +func (x *UpdateLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateLine.ProtoReflect.Descriptor instead. +func (*UpdateLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{59} +} + +func (x *UpdateLine) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +func (x *UpdateLine) GetGoodsName() string { + if x != nil && x.GoodsName != nil { + return *x.GoodsName + } + return "" +} + +func (x *UpdateLine) GetSpecCombination() string { + if x != nil && x.SpecCombination != nil { + return *x.SpecCombination + } + return "" +} + +func (x *UpdateLine) GetQuantity() float64 { + if x != nil && x.Quantity != nil { + return *x.Quantity + } + return 0 +} + +func (x *UpdateLine) GetUnitPrice() int64 { + if x != nil && x.UnitPrice != nil { + return *x.UnitPrice + } + return 0 +} + +func (x *UpdateLine) GetCostPrice() int64 { + if x != nil && x.CostPrice != nil { + return *x.CostPrice + } + return 0 +} + +func (x *UpdateLine) GetDiscountRate() int32 { + if x != nil && x.DiscountRate != nil { + return *x.DiscountRate + } + return 0 +} + +func (x *UpdateLine) GetDiscountAmount() int64 { + if x != nil && x.DiscountAmount != nil { + return *x.DiscountAmount + } + return 0 +} + +func (x *UpdateLine) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +type MoveLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + FloorId string `protobuf:"bytes,2,opt,name=floor_id,json=floorId,proto3" json:"floor_id,omitempty"` + SpaceId string `protobuf:"bytes,3,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` + CategoryId string `protobuf:"bytes,4,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Index int32 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MoveLine) Reset() { + *x = MoveLine{} + mi := &file_shop_crm_agent_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MoveLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveLine) ProtoMessage() {} + +func (x *MoveLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MoveLine.ProtoReflect.Descriptor instead. +func (*MoveLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{60} +} + +func (x *MoveLine) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +func (x *MoveLine) GetFloorId() string { + if x != nil { + return x.FloorId + } + return "" +} + +func (x *MoveLine) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *MoveLine) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + +func (x *MoveLine) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type ReorderLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReorderLine) Reset() { + *x = ReorderLine{} + mi := &file_shop_crm_agent_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReorderLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderLine) ProtoMessage() {} + +func (x *ReorderLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReorderLine.ProtoReflect.Descriptor instead. +func (*ReorderLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{61} +} + +func (x *ReorderLine) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +func (x *ReorderLine) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type SetLineActive struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + Active bool `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetLineActive) Reset() { + *x = SetLineActive{} + mi := &file_shop_crm_agent_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetLineActive) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetLineActive) ProtoMessage() {} + +func (x *SetLineActive) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[62] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetLineActive.ProtoReflect.Descriptor instead. +func (*SetLineActive) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{62} +} + +func (x *SetLineActive) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +func (x *SetLineActive) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +type RemoveLine struct { + state protoimpl.MessageState `protogen:"open.v1"` + LineId string `protobuf:"bytes,1,opt,name=line_id,json=lineId,proto3" json:"line_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveLine) Reset() { + *x = RemoveLine{} + mi := &file_shop_crm_agent_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveLine) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveLine) ProtoMessage() {} + +func (x *RemoveLine) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[63] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveLine.ProtoReflect.Descriptor instead. +func (*RemoveLine) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{63} +} + +func (x *RemoveLine) GetLineId() string { + if x != nil { + return x.LineId + } + return "" +} + +type AddFee struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + FixedAmount int64 `protobuf:"varint,3,opt,name=fixed_amount,json=fixedAmount,proto3" json:"fixed_amount,omitempty"` + Percentage int32 `protobuf:"varint,4,opt,name=percentage,proto3" json:"percentage,omitempty"` + Index int32 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddFee) Reset() { + *x = AddFee{} + mi := &file_shop_crm_agent_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddFee) ProtoMessage() {} + +func (x *AddFee) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddFee.ProtoReflect.Descriptor instead. +func (*AddFee) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{64} +} + +func (x *AddFee) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddFee) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *AddFee) GetFixedAmount() int64 { + if x != nil { + return x.FixedAmount + } + return 0 +} + +func (x *AddFee) GetPercentage() int32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *AddFee) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *AddFee) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +type UpdateFee struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + Type *string `protobuf:"bytes,3,opt,name=type,proto3,oneof" json:"type,omitempty"` + FixedAmount *int64 `protobuf:"varint,4,opt,name=fixed_amount,json=fixedAmount,proto3,oneof" json:"fixed_amount,omitempty"` + Percentage *int32 `protobuf:"varint,5,opt,name=percentage,proto3,oneof" json:"percentage,omitempty"` + Remark *string `protobuf:"bytes,6,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateFee) Reset() { + *x = UpdateFee{} + mi := &file_shop_crm_agent_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateFee) ProtoMessage() {} + +func (x *UpdateFee) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[65] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateFee.ProtoReflect.Descriptor instead. +func (*UpdateFee) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{65} +} + +func (x *UpdateFee) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *UpdateFee) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *UpdateFee) GetType() string { + if x != nil && x.Type != nil { + return *x.Type + } + return "" +} + +func (x *UpdateFee) GetFixedAmount() int64 { + if x != nil && x.FixedAmount != nil { + return *x.FixedAmount + } + return 0 +} + +func (x *UpdateFee) GetPercentage() int32 { + if x != nil && x.Percentage != nil { + return *x.Percentage + } + return 0 +} + +func (x *UpdateFee) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +type ReorderFee struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + TargetIndex int32 `protobuf:"varint,2,opt,name=target_index,json=targetIndex,proto3" json:"target_index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReorderFee) Reset() { + *x = ReorderFee{} + mi := &file_shop_crm_agent_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReorderFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderFee) ProtoMessage() {} + +func (x *ReorderFee) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[66] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReorderFee.ProtoReflect.Descriptor instead. +func (*ReorderFee) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{66} +} + +func (x *ReorderFee) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *ReorderFee) GetTargetIndex() int32 { + if x != nil { + return x.TargetIndex + } + return 0 +} + +type RemoveFee struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveFee) Reset() { + *x = RemoveFee{} + mi := &file_shop_crm_agent_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveFee) ProtoMessage() {} + +func (x *RemoveFee) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[67] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveFee.ProtoReflect.Descriptor instead. +func (*RemoveFee) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{67} +} + +func (x *RemoveFee) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +type SetPricing struct { + state protoimpl.MessageState `protogen:"open.v1"` + DiscountRate *int32 `protobuf:"varint,1,opt,name=discount_rate,json=discountRate,proto3,oneof" json:"discount_rate,omitempty"` + DiscountAmount *int64 `protobuf:"varint,2,opt,name=discount_amount,json=discountAmount,proto3,oneof" json:"discount_amount,omitempty"` + ActualAmount *int64 `protobuf:"varint,3,opt,name=actual_amount,json=actualAmount,proto3,oneof" json:"actual_amount,omitempty"` + HasPriceAdjustment *bool `protobuf:"varint,4,opt,name=has_price_adjustment,json=hasPriceAdjustment,proto3,oneof" json:"has_price_adjustment,omitempty"` + Remark *string `protobuf:"bytes,5,opt,name=remark,proto3,oneof" json:"remark,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetPricing) Reset() { + *x = SetPricing{} + mi := &file_shop_crm_agent_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetPricing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPricing) ProtoMessage() {} + +func (x *SetPricing) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[68] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPricing.ProtoReflect.Descriptor instead. +func (*SetPricing) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{68} +} + +func (x *SetPricing) GetDiscountRate() int32 { + if x != nil && x.DiscountRate != nil { + return *x.DiscountRate + } + return 0 +} + +func (x *SetPricing) GetDiscountAmount() int64 { + if x != nil && x.DiscountAmount != nil { + return *x.DiscountAmount + } + return 0 +} + +func (x *SetPricing) GetActualAmount() int64 { + if x != nil && x.ActualAmount != nil { + return *x.ActualAmount + } + return 0 +} + +func (x *SetPricing) GetHasPriceAdjustment() bool { + if x != nil && x.HasPriceAdjustment != nil { + return *x.HasPriceAdjustment + } + return false +} + +func (x *SetPricing) GetRemark() string { + if x != nil && x.Remark != nil { + return *x.Remark + } + return "" +} + +type QuotationEditCommandRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + // Types that are valid to be assigned to Edit: + // + // *QuotationEditCommandRequest_AddFloor + // *QuotationEditCommandRequest_RenameFloor + // *QuotationEditCommandRequest_ReorderFloor + // *QuotationEditCommandRequest_RemoveFloor + // *QuotationEditCommandRequest_AddSpace + // *QuotationEditCommandRequest_RenameSpace + // *QuotationEditCommandRequest_MoveSpace + // *QuotationEditCommandRequest_ReorderSpace + // *QuotationEditCommandRequest_RemoveSpace + // *QuotationEditCommandRequest_AddCategory + // *QuotationEditCommandRequest_RenameCategory + // *QuotationEditCommandRequest_ReorderCategory + // *QuotationEditCommandRequest_RemoveCategory + // *QuotationEditCommandRequest_AddCatalogLine + // *QuotationEditCommandRequest_AddCustomLine + // *QuotationEditCommandRequest_UpdateLine + // *QuotationEditCommandRequest_MoveLine + // *QuotationEditCommandRequest_ReorderLine + // *QuotationEditCommandRequest_SetLineActive + // *QuotationEditCommandRequest_RemoveLine + // *QuotationEditCommandRequest_AddFee + // *QuotationEditCommandRequest_UpdateFee + // *QuotationEditCommandRequest_ReorderFee + // *QuotationEditCommandRequest_RemoveFee + // *QuotationEditCommandRequest_SetPricing + Edit isQuotationEditCommandRequest_Edit `protobuf_oneof:"edit"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditCommandRequest) Reset() { + *x = QuotationEditCommandRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditCommandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditCommandRequest) ProtoMessage() {} + +func (x *QuotationEditCommandRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[69] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditCommandRequest.ProtoReflect.Descriptor instead. +func (*QuotationEditCommandRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{69} +} + +func (x *QuotationEditCommandRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationEditCommandRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *QuotationEditCommandRequest) GetEdit() isQuotationEditCommandRequest_Edit { + if x != nil { + return x.Edit + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddFloor() *AddFloor { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddFloor); ok { + return x.AddFloor + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRenameFloor() *RenameFloor { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RenameFloor); ok { + return x.RenameFloor + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetReorderFloor() *ReorderFloor { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_ReorderFloor); ok { + return x.ReorderFloor + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRemoveFloor() *RemoveFloor { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RemoveFloor); ok { + return x.RemoveFloor + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddSpace() *AddSpace { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddSpace); ok { + return x.AddSpace + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRenameSpace() *RenameSpace { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RenameSpace); ok { + return x.RenameSpace + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetMoveSpace() *MoveSpace { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_MoveSpace); ok { + return x.MoveSpace + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetReorderSpace() *ReorderSpace { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_ReorderSpace); ok { + return x.ReorderSpace + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRemoveSpace() *RemoveSpace { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RemoveSpace); ok { + return x.RemoveSpace + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddCategory() *AddCategory { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddCategory); ok { + return x.AddCategory + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRenameCategory() *RenameCategory { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RenameCategory); ok { + return x.RenameCategory + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetReorderCategory() *ReorderCategory { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_ReorderCategory); ok { + return x.ReorderCategory + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRemoveCategory() *RemoveCategory { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RemoveCategory); ok { + return x.RemoveCategory + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddCatalogLine() *AddCatalogLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddCatalogLine); ok { + return x.AddCatalogLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddCustomLine() *AddCustomLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddCustomLine); ok { + return x.AddCustomLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetUpdateLine() *UpdateLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_UpdateLine); ok { + return x.UpdateLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetMoveLine() *MoveLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_MoveLine); ok { + return x.MoveLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetReorderLine() *ReorderLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_ReorderLine); ok { + return x.ReorderLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetSetLineActive() *SetLineActive { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_SetLineActive); ok { + return x.SetLineActive + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRemoveLine() *RemoveLine { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RemoveLine); ok { + return x.RemoveLine + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetAddFee() *AddFee { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_AddFee); ok { + return x.AddFee + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetUpdateFee() *UpdateFee { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_UpdateFee); ok { + return x.UpdateFee + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetReorderFee() *ReorderFee { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_ReorderFee); ok { + return x.ReorderFee + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetRemoveFee() *RemoveFee { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_RemoveFee); ok { + return x.RemoveFee + } + } + return nil +} + +func (x *QuotationEditCommandRequest) GetSetPricing() *SetPricing { + if x != nil { + if x, ok := x.Edit.(*QuotationEditCommandRequest_SetPricing); ok { + return x.SetPricing + } + } + return nil +} + +type isQuotationEditCommandRequest_Edit interface { + isQuotationEditCommandRequest_Edit() +} + +type QuotationEditCommandRequest_AddFloor struct { + AddFloor *AddFloor `protobuf:"bytes,10,opt,name=add_floor,json=addFloor,proto3,oneof"` +} + +type QuotationEditCommandRequest_RenameFloor struct { + RenameFloor *RenameFloor `protobuf:"bytes,11,opt,name=rename_floor,json=renameFloor,proto3,oneof"` +} + +type QuotationEditCommandRequest_ReorderFloor struct { + ReorderFloor *ReorderFloor `protobuf:"bytes,12,opt,name=reorder_floor,json=reorderFloor,proto3,oneof"` +} + +type QuotationEditCommandRequest_RemoveFloor struct { + RemoveFloor *RemoveFloor `protobuf:"bytes,13,opt,name=remove_floor,json=removeFloor,proto3,oneof"` +} + +type QuotationEditCommandRequest_AddSpace struct { + AddSpace *AddSpace `protobuf:"bytes,14,opt,name=add_space,json=addSpace,proto3,oneof"` +} + +type QuotationEditCommandRequest_RenameSpace struct { + RenameSpace *RenameSpace `protobuf:"bytes,15,opt,name=rename_space,json=renameSpace,proto3,oneof"` +} + +type QuotationEditCommandRequest_MoveSpace struct { + MoveSpace *MoveSpace `protobuf:"bytes,16,opt,name=move_space,json=moveSpace,proto3,oneof"` +} + +type QuotationEditCommandRequest_ReorderSpace struct { + ReorderSpace *ReorderSpace `protobuf:"bytes,17,opt,name=reorder_space,json=reorderSpace,proto3,oneof"` +} + +type QuotationEditCommandRequest_RemoveSpace struct { + RemoveSpace *RemoveSpace `protobuf:"bytes,18,opt,name=remove_space,json=removeSpace,proto3,oneof"` +} + +type QuotationEditCommandRequest_AddCategory struct { + AddCategory *AddCategory `protobuf:"bytes,19,opt,name=add_category,json=addCategory,proto3,oneof"` +} + +type QuotationEditCommandRequest_RenameCategory struct { + RenameCategory *RenameCategory `protobuf:"bytes,20,opt,name=rename_category,json=renameCategory,proto3,oneof"` +} + +type QuotationEditCommandRequest_ReorderCategory struct { + ReorderCategory *ReorderCategory `protobuf:"bytes,21,opt,name=reorder_category,json=reorderCategory,proto3,oneof"` +} + +type QuotationEditCommandRequest_RemoveCategory struct { + RemoveCategory *RemoveCategory `protobuf:"bytes,22,opt,name=remove_category,json=removeCategory,proto3,oneof"` +} + +type QuotationEditCommandRequest_AddCatalogLine struct { + AddCatalogLine *AddCatalogLine `protobuf:"bytes,23,opt,name=add_catalog_line,json=addCatalogLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_AddCustomLine struct { + AddCustomLine *AddCustomLine `protobuf:"bytes,24,opt,name=add_custom_line,json=addCustomLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_UpdateLine struct { + UpdateLine *UpdateLine `protobuf:"bytes,25,opt,name=update_line,json=updateLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_MoveLine struct { + MoveLine *MoveLine `protobuf:"bytes,26,opt,name=move_line,json=moveLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_ReorderLine struct { + ReorderLine *ReorderLine `protobuf:"bytes,27,opt,name=reorder_line,json=reorderLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_SetLineActive struct { + SetLineActive *SetLineActive `protobuf:"bytes,28,opt,name=set_line_active,json=setLineActive,proto3,oneof"` +} + +type QuotationEditCommandRequest_RemoveLine struct { + RemoveLine *RemoveLine `protobuf:"bytes,29,opt,name=remove_line,json=removeLine,proto3,oneof"` +} + +type QuotationEditCommandRequest_AddFee struct { + AddFee *AddFee `protobuf:"bytes,30,opt,name=add_fee,json=addFee,proto3,oneof"` +} + +type QuotationEditCommandRequest_UpdateFee struct { + UpdateFee *UpdateFee `protobuf:"bytes,31,opt,name=update_fee,json=updateFee,proto3,oneof"` +} + +type QuotationEditCommandRequest_ReorderFee struct { + ReorderFee *ReorderFee `protobuf:"bytes,32,opt,name=reorder_fee,json=reorderFee,proto3,oneof"` +} + +type QuotationEditCommandRequest_RemoveFee struct { + RemoveFee *RemoveFee `protobuf:"bytes,33,opt,name=remove_fee,json=removeFee,proto3,oneof"` +} + +type QuotationEditCommandRequest_SetPricing struct { + SetPricing *SetPricing `protobuf:"bytes,34,opt,name=set_pricing,json=setPricing,proto3,oneof"` +} + +func (*QuotationEditCommandRequest_AddFloor) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RenameFloor) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_ReorderFloor) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RemoveFloor) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_AddSpace) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RenameSpace) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_MoveSpace) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_ReorderSpace) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RemoveSpace) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_AddCategory) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RenameCategory) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_ReorderCategory) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RemoveCategory) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_AddCatalogLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_AddCustomLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_UpdateLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_MoveLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_ReorderLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_SetLineActive) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RemoveLine) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_AddFee) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_UpdateFee) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_ReorderFee) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_RemoveFee) isQuotationEditCommandRequest_Edit() {} + +func (*QuotationEditCommandRequest_SetPricing) isQuotationEditCommandRequest_Edit() {} + +type QuotationEditCommandResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Session *EditSession `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"` + AffectedLineIds []string `protobuf:"bytes,3,rep,name=affected_line_ids,json=affectedLineIds,proto3" json:"affected_line_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditCommandResponse) Reset() { + *x = QuotationEditCommandResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditCommandResponse) ProtoMessage() {} + +func (x *QuotationEditCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[70] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditCommandResponse.ProtoReflect.Descriptor instead. +func (*QuotationEditCommandResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{70} +} + +func (x *QuotationEditCommandResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *QuotationEditCommandResponse) GetSession() *EditSession { + if x != nil { + return x.Session + } + return nil +} + +func (x *QuotationEditCommandResponse) GetAffectedLineIds() []string { + if x != nil { + return x.AffectedLineIds + } + return nil +} + +type QuotationEditPreviewRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditPreviewRequest) Reset() { + *x = QuotationEditPreviewRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditPreviewRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditPreviewRequest) ProtoMessage() {} + +func (x *QuotationEditPreviewRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditPreviewRequest.ProtoReflect.Descriptor instead. +func (*QuotationEditPreviewRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{71} +} + +func (x *QuotationEditPreviewRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type QuotationEditPreviewResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Revision int32 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` + ChangeSetId string `protobuf:"bytes,4,opt,name=change_set_id,json=changeSetId,proto3" json:"change_set_id,omitempty"` + Quotation *Quotation `protobuf:"bytes,5,opt,name=quotation,proto3" json:"quotation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditPreviewResponse) Reset() { + *x = QuotationEditPreviewResponse{} + mi := &file_shop_crm_agent_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditPreviewResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditPreviewResponse) ProtoMessage() {} + +func (x *QuotationEditPreviewResponse) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[72] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditPreviewResponse.ProtoReflect.Descriptor instead. +func (*QuotationEditPreviewResponse) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{72} +} + +func (x *QuotationEditPreviewResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *QuotationEditPreviewResponse) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *QuotationEditPreviewResponse) GetRevision() int32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *QuotationEditPreviewResponse) GetChangeSetId() string { + if x != nil { + return x.ChangeSetId + } + return "" +} + +func (x *QuotationEditPreviewResponse) GetQuotation() *Quotation { + if x != nil { + return x.Quotation + } + return nil +} + +type QuotationEditCommitRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Revision int32 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` + ChangeSetId string `protobuf:"bytes,4,opt,name=change_set_id,json=changeSetId,proto3" json:"change_set_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditCommitRequest) Reset() { + *x = QuotationEditCommitRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditCommitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditCommitRequest) ProtoMessage() {} + +func (x *QuotationEditCommitRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[73] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditCommitRequest.ProtoReflect.Descriptor instead. +func (*QuotationEditCommitRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{73} +} + +func (x *QuotationEditCommitRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationEditCommitRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *QuotationEditCommitRequest) GetRevision() int32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *QuotationEditCommitRequest) GetChangeSetId() string { + if x != nil { + return x.ChangeSetId + } + return "" +} + +type QuotationEditDiscardRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command *CommandHeader `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QuotationEditDiscardRequest) Reset() { + *x = QuotationEditDiscardRequest{} + mi := &file_shop_crm_agent_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuotationEditDiscardRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuotationEditDiscardRequest) ProtoMessage() {} + +func (x *QuotationEditDiscardRequest) ProtoReflect() protoreflect.Message { + mi := &file_shop_crm_agent_proto_msgTypes[74] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuotationEditDiscardRequest.ProtoReflect.Descriptor instead. +func (*QuotationEditDiscardRequest) Descriptor() ([]byte, []int) { + return file_shop_crm_agent_proto_rawDescGZIP(), []int{74} +} + +func (x *QuotationEditDiscardRequest) GetCommand() *CommandHeader { + if x != nil { + return x.Command + } + return nil +} + +func (x *QuotationEditDiscardRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +var File_shop_crm_agent_proto protoreflect.FileDescriptor + +const file_shop_crm_agent_proto_rawDesc = "" + + "\n" + + "\x14shop_crm_agent.proto\x12\x1blightcore.shop.crm_agent.v1\"y\n" + + "\x0eResponseHeader\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x1d\n" + + "\n" + + "request_id\x18\x03 \x01(\tR\trequestId\x12\x1a\n" + + "\breplayed\x18\x04 \x01(\bR\breplayed\".\n" + + "\rCommandHeader\x12\x1d\n" + + "\n" + + "request_id\x18\x01 \x01(\tR\trequestId\"U\n" + + "\x0eCommonResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\"Q\n" + + "\bPageInfo\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05total\x18\x03 \x01(\x03R\x05total\"\xfe\x01\n" + + "\bCustomer\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x04R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05phone\x18\x03 \x01(\tR\x05phone\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x16\n" + + "\x06source\x18\x05 \x01(\tR\x06source\x12\x1a\n" + + "\bprovince\x18\x06 \x01(\tR\bprovince\x12\x12\n" + + "\x04city\x18\a \x01(\tR\x04city\x12\x1a\n" + + "\bdistrict\x18\b \x01(\tR\bdistrict\x12\x1d\n" + + "\n" + + "created_at\x18\t \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\n" + + " \x01(\x03R\tupdatedAt\"`\n" + + "\x13CustomerListRequest\x12\x18\n" + + "\akeyword\x18\x01 \x01(\tR\akeyword\x12\x12\n" + + "\x04page\x18\x02 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\"\xdb\x01\n" + + "\x14CustomerListResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12C\n" + + "\tcustomers\x18\x02 \x03(\v2%.lightcore.shop.crm_agent.v1.CustomerR\tcustomers\x129\n" + + "\x04page\x18\x03 \x01(\v2%.lightcore.shop.crm_agent.v1.PageInfoR\x04page\"\x8d\x05\n" + + "\aProject\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x04R\x02id\x12\x1d\n" + + "\n" + + "project_no\x18\x02 \x01(\tR\tprojectNo\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x1d\n" + + "\n" + + "house_type\x18\x05 \x01(\tR\thouseType\x12\x1a\n" + + "\bprovince\x18\x06 \x01(\tR\bprovince\x12#\n" + + "\rprovince_code\x18\a \x01(\tR\fprovinceCode\x12\x12\n" + + "\x04city\x18\b \x01(\tR\x04city\x12\x1b\n" + + "\tcity_code\x18\t \x01(\tR\bcityCode\x12\x1a\n" + + "\bdistrict\x18\n" + + " \x01(\tR\bdistrict\x12#\n" + + "\rdistrict_code\x18\v \x01(\tR\fdistrictCode\x12\x18\n" + + "\aaddress\x18\f \x01(\tR\aaddress\x12\x1f\n" + + "\vcustomer_id\x18\x10 \x01(\x04R\n" + + "customerId\x12#\n" + + "\rcustomer_name\x18\x11 \x01(\tR\fcustomerName\x12%\n" + + "\x0ecustomer_phone\x18\x12 \x01(\tR\rcustomerPhone\x12\x16\n" + + "\x06remark\x18\x13 \x01(\tR\x06remark\x12'\n" + + "\x0fquotation_count\x18\x14 \x01(\x05R\x0equotationCount\x12\x1d\n" + + "\n" + + "created_at\x18\x15 \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\x16 \x01(\x03R\tupdatedAtJ\x04\b\r\x10\x0eJ\x04\b\x0e\x10\x0fJ\x04\b\x0f\x10\x10R\x15progress_template_keyR\x16progress_template_nameR\x0eprogress_steps\"\x96\x01\n" + + "\x12ProjectListRequest\x12\x18\n" + + "\akeyword\x18\x01 \x01(\tR\akeyword\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12\x1d\n" + + "\n" + + "house_type\x18\x03 \x01(\tR\thouseType\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\x05R\bpageSize\"\xd7\x01\n" + + "\x13ProjectListResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12@\n" + + "\bprojects\x18\x02 \x03(\v2$.lightcore.shop.crm_agent.v1.ProjectR\bprojects\x129\n" + + "\x04page\x18\x03 \x01(\v2%.lightcore.shop.crm_agent.v1.PageInfoR\x04page\"2\n" + + "\x11ProjectGetRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\x04R\tprojectId\"\x96\x01\n" + + "\x0fProjectResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12>\n" + + "\aproject\x18\x02 \x01(\v2$.lightcore.shop.crm_agent.v1.ProjectR\aproject\"\xb2\x03\n" + + "\x14ProjectCreateRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1f\n" + + "\vcustomer_id\x18\x03 \x01(\x04R\n" + + "customerId\x12\x1d\n" + + "\n" + + "house_type\x18\x04 \x01(\tR\thouseType\x12\x1a\n" + + "\bprovince\x18\x05 \x01(\tR\bprovince\x12#\n" + + "\rprovince_code\x18\x06 \x01(\tR\fprovinceCode\x12\x12\n" + + "\x04city\x18\a \x01(\tR\x04city\x12\x1b\n" + + "\tcity_code\x18\b \x01(\tR\bcityCode\x12\x1a\n" + + "\bdistrict\x18\t \x01(\tR\bdistrict\x12#\n" + + "\rdistrict_code\x18\n" + + " \x01(\tR\fdistrictCode\x12\x18\n" + + "\aaddress\x18\v \x01(\tR\aaddress\x12\x16\n" + + "\x06remark\x18\r \x01(\tR\x06remarkJ\x04\b\f\x10\rR\x15progress_template_key\"\xe6\x04\n" + + "\x14ProjectUpdateRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\x04R\tprojectId\x12\x17\n" + + "\x04name\x18\x03 \x01(\tH\x00R\x04name\x88\x01\x01\x12\"\n" + + "\n" + + "house_type\x18\x04 \x01(\tH\x01R\thouseType\x88\x01\x01\x12\x1f\n" + + "\bprovince\x18\x05 \x01(\tH\x02R\bprovince\x88\x01\x01\x12(\n" + + "\rprovince_code\x18\x06 \x01(\tH\x03R\fprovinceCode\x88\x01\x01\x12\x17\n" + + "\x04city\x18\a \x01(\tH\x04R\x04city\x88\x01\x01\x12 \n" + + "\tcity_code\x18\b \x01(\tH\x05R\bcityCode\x88\x01\x01\x12\x1f\n" + + "\bdistrict\x18\t \x01(\tH\x06R\bdistrict\x88\x01\x01\x12(\n" + + "\rdistrict_code\x18\n" + + " \x01(\tH\aR\fdistrictCode\x88\x01\x01\x12\x1d\n" + + "\aaddress\x18\v \x01(\tH\bR\aaddress\x88\x01\x01\x12\x1b\n" + + "\x06remark\x18\r \x01(\tH\tR\x06remark\x88\x01\x01B\a\n" + + "\x05_nameB\r\n" + + "\v_house_typeB\v\n" + + "\t_provinceB\x10\n" + + "\x0e_province_codeB\a\n" + + "\x05_cityB\f\n" + + "\n" + + "_city_codeB\v\n" + + "\t_districtB\x10\n" + + "\x0e_district_codeB\n" + + "\n" + + "\b_addressB\t\n" + + "\a_remarkJ\x04\b\f\x10\rR\x15progress_template_key\"\x93\x01\n" + + "\x14ProjectStatusRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\x04R\tprojectId\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\"<\n" + + "\x1bProjectDeletePreviewRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\x04R\tprojectId\"\xc9\x01\n" + + "\rDeletePreview\x12#\n" + + "\rresource_type\x18\x01 \x01(\tR\fresourceType\x12\x1f\n" + + "\vresource_id\x18\x02 \x01(\x04R\n" + + "resourceId\x12\x1a\n" + + "\brevision\x18\x03 \x01(\x05R\brevision\x12\"\n" + + "\rchange_set_id\x18\x04 \x01(\tR\vchangeSetId\x12\x18\n" + + "\aallowed\x18\x05 \x01(\bR\aallowed\x12\x18\n" + + "\areasons\x18\x06 \x03(\tR\areasons\"\xa2\x01\n" + + "\x15DeletePreviewResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12D\n" + + "\apreview\x18\x02 \x01(\v2*.lightcore.shop.crm_agent.v1.DeletePreviewR\apreview\"\x9f\x01\n" + + "\x14ProjectDeleteRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\x04R\tprojectId\x12\"\n" + + "\rchange_set_id\x18\x03 \x01(\tR\vchangeSetId\"\x95\x04\n" + + "\x10QuotationSummary\x12!\n" + + "\fquotation_id\x18\x01 \x01(\x04R\vquotationId\x12\x1f\n" + + "\vartifact_id\x18\x02 \x01(\x04R\n" + + "artifactId\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\x04R\tprojectId\x12\x1d\n" + + "\n" + + "project_no\x18\x04 \x01(\tR\tprojectNo\x12!\n" + + "\fproject_name\x18\x05 \x01(\tR\vprojectName\x12#\n" + + "\rcustomer_name\x18\x06 \x01(\tR\fcustomerName\x12\x14\n" + + "\x05title\x18\a \x01(\tR\x05title\x12\x16\n" + + "\x06status\x18\b \x01(\tR\x06status\x12\x1a\n" + + "\brevision\x18\t \x01(\x05R\brevision\x12\x16\n" + + "\x06locked\x18\n" + + " \x01(\bR\x06locked\x12!\n" + + "\ffinal_amount\x18\v \x01(\x03R\vfinalAmount\x12#\n" + + "\ractual_amount\x18\f \x01(\x03R\factualAmount\x12\x1d\n" + + "\n" + + "item_count\x18\r \x01(\x05R\titemCount\x120\n" + + "\x14has_price_adjustment\x18\x0e \x01(\bR\x12hasPriceAdjustment\x12\x1d\n" + + "\n" + + "created_at\x18\x0f \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\x10 \x01(\x03R\tupdatedAt\"n\n" + + "\x11QuotationCategory\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + + "\x06source\x18\x03 \x01(\tR\x06source\x12\x1d\n" + + "\n" + + "source_key\x18\x04 \x01(\tR\tsourceKey\"\x84\x01\n" + + "\x0eQuotationSpace\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12N\n" + + "\n" + + "categories\x18\x03 \x03(\v2..lightcore.shop.crm_agent.v1.QuotationCategoryR\n" + + "categories\"y\n" + + "\x0eQuotationFloor\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12C\n" + + "\x06spaces\x18\x03 \x03(\v2+.lightcore.shop.crm_agent.v1.QuotationSpaceR\x06spaces\"\xc7\x06\n" + + "\rQuotationLine\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\x12\x19\n" + + "\bfloor_id\x18\x02 \x01(\tR\afloorId\x12\x19\n" + + "\bspace_id\x18\x03 \x01(\tR\aspaceId\x12\x1f\n" + + "\vcategory_id\x18\x04 \x01(\tR\n" + + "categoryId\x12\x1f\n" + + "\vsource_type\x18\x05 \x01(\tR\n" + + "sourceType\x12\x1d\n" + + "\n" + + "product_id\x18\x06 \x01(\x04R\tproductId\x12\x15\n" + + "\x06sku_id\x18\a \x01(\x04R\x05skuId\x12\x1d\n" + + "\n" + + "goods_name\x18\b \x01(\tR\tgoodsName\x12)\n" + + "\x10spec_combination\x18\t \x01(\tR\x0fspecCombination\x12\x19\n" + + "\bimage_id\x18\n" + + " \x01(\x04R\aimageId\x12\x1b\n" + + "\timage_url\x18\v \x01(\tR\bimageUrl\x12#\n" + + "\rcategory_name\x18\f \x01(\tR\fcategoryName\x12\x1d\n" + + "\n" + + "sort_order\x18\r \x01(\x05R\tsortOrder\x12\x16\n" + + "\x06remark\x18\x0e \x01(\tR\x06remark\x12\x16\n" + + "\x06active\x18\x0f \x01(\bR\x06active\x12\x1d\n" + + "\n" + + "unit_price\x18\x10 \x01(\x03R\tunitPrice\x12\x1a\n" + + "\bquantity\x18\x11 \x01(\x01R\bquantity\x12#\n" + + "\rdiscount_rate\x18\x12 \x01(\x05R\fdiscountRate\x12'\n" + + "\x0fdiscount_amount\x18\x13 \x01(\x03R\x0ediscountAmount\x12\x1d\n" + + "\n" + + "cost_price\x18\x14 \x01(\x03R\tcostPrice\x12+\n" + + "\x11original_subtotal\x18\x15 \x01(\x03R\x10originalSubtotal\x12/\n" + + "\x13discounted_subtotal\x18\x16 \x01(\x03R\x12discountedSubtotal\x12%\n" + + "\x0efinal_subtotal\x18\x17 \x01(\x03R\rfinalSubtotal\x12#\n" + + "\rcost_subtotal\x18\x18 \x01(\x03R\fcostSubtotal\x12'\n" + + "\x0fprofit_subtotal\x18\x19 \x01(\x03R\x0eprofitSubtotal\"\xde\x01\n" + + "\fQuotationFee\x12\x14\n" + + "\x05index\x18\x01 \x01(\x05R\x05index\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12!\n" + + "\ffixed_amount\x18\x04 \x01(\x03R\vfixedAmount\x12\x1e\n" + + "\n" + + "percentage\x18\x05 \x01(\x05R\n" + + "percentage\x12\x1d\n" + + "\n" + + "sort_order\x18\x06 \x01(\x05R\tsortOrder\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x16\n" + + "\x06amount\x18\b \x01(\x03R\x06amount\"\xed\x06\n" + + "\tQuotation\x12G\n" + + "\asummary\x18\x01 \x01(\v2-.lightcore.shop.crm_agent.v1.QuotationSummaryR\asummary\x12C\n" + + "\x06floors\x18\x02 \x03(\v2+.lightcore.shop.crm_agent.v1.QuotationFloorR\x06floors\x12@\n" + + "\x05lines\x18\x03 \x03(\v2*.lightcore.shop.crm_agent.v1.QuotationLineR\x05lines\x12=\n" + + "\x04fees\x18\x04 \x03(\v2).lightcore.shop.crm_agent.v1.QuotationFeeR\x04fees\x12#\n" + + "\rdiscount_rate\x18\x05 \x01(\x05R\fdiscountRate\x12'\n" + + "\x0fdiscount_amount\x18\x06 \x01(\x03R\x0ediscountAmount\x122\n" + + "\x15original_total_amount\x18\a \x01(\x03R\x13originalTotalAmount\x12!\n" + + "\ftotal_amount\x18\b \x01(\x03R\vtotalAmount\x12+\n" + + "\x11discounted_amount\x18\t \x01(\x03R\x10discountedAmount\x12(\n" + + "\x10total_fee_amount\x18\n" + + " \x01(\x03R\x0etotalFeeAmount\x12!\n" + + "\ffinal_amount\x18\v \x01(\x03R\vfinalAmount\x12#\n" + + "\ractual_amount\x18\f \x01(\x03R\factualAmount\x120\n" + + "\x14has_price_adjustment\x18\r \x01(\bR\x12hasPriceAdjustment\x12\x1d\n" + + "\n" + + "total_cost\x18\x0e \x01(\x03R\ttotalCost\x12%\n" + + "\x0eproduct_profit\x18\x0f \x01(\x03R\rproductProfit\x12!\n" + + "\ftotal_profit\x18\x10 \x01(\x03R\vtotalProfit\x12.\n" + + "\x13product_profit_rate\x18\x11 \x01(\x01R\x11productProfitRate\x12*\n" + + "\x11total_profit_rate\x18\x12 \x01(\x01R\x0ftotalProfitRate\x12\x16\n" + + "\x06remark\x18\x13 \x01(\tR\x06remark\"\x98\x01\n" + + "\x14QuotationListRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\x04R\tprojectId\x12\x18\n" + + "\akeyword\x18\x02 \x01(\tR\akeyword\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\x05R\bpageSize\"\xe6\x01\n" + + "\x15QuotationListResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12M\n" + + "\n" + + "quotations\x18\x02 \x03(\v2-.lightcore.shop.crm_agent.v1.QuotationSummaryR\n" + + "quotations\x129\n" + + "\x04page\x18\x03 \x01(\v2%.lightcore.shop.crm_agent.v1.PageInfoR\x04page\"8\n" + + "\x13QuotationGetRequest\x12!\n" + + "\fquotation_id\x18\x01 \x01(\x04R\vquotationId\"\x9e\x01\n" + + "\x11QuotationResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12D\n" + + "\tquotation\x18\x02 \x01(\v2&.lightcore.shop.crm_agent.v1.QuotationR\tquotation\"\x93\x01\n" + + "\x16QuotationCreateRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\x04R\tprojectId\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\"\x95\x01\n" + + "\x14QuotationCopyRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\"\x96\x01\n" + + "\x15QuotationTitleRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\"\x99\x01\n" + + "\x16QuotationStatusRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\"\x7f\n" + + "\x14QuotationLockRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\"B\n" + + "\x1dQuotationDeletePreviewRequest\x12!\n" + + "\fquotation_id\x18\x01 \x01(\x04R\vquotationId\"\xc1\x01\n" + + "\x16QuotationDeleteRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\x12\x1a\n" + + "\brevision\x18\x03 \x01(\x05R\brevision\x12\"\n" + + "\rchange_set_id\x18\x04 \x01(\tR\vchangeSetId\"\x8e\x03\n" + + "\n" + + "CatalogSku\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x04R\x02id\x12\x1d\n" + + "\n" + + "product_id\x18\x02 \x01(\x04R\tproductId\x12\x19\n" + + "\bsku_code\x18\x03 \x01(\tR\askuCode\x12\x19\n" + + "\bsku_name\x18\x04 \x01(\tR\askuName\x12!\n" + + "\fproduct_name\x18\x05 \x01(\tR\vproductName\x12%\n" + + "\x0equotation_name\x18\x06 \x01(\tR\rquotationName\x12#\n" + + "\rcategory_name\x18\a \x01(\tR\fcategoryName\x12)\n" + + "\x10spec_combination\x18\b \x01(\tR\x0fspecCombination\x12\x1f\n" + + "\vprice_cents\x18\t \x01(\x03R\n" + + "priceCents\x12(\n" + + "\x10cost_price_cents\x18\n" + + " \x01(\x03R\x0ecostPriceCents\x12\x19\n" + + "\bimage_id\x18\v \x01(\x04R\aimageId\x12\x1b\n" + + "\timage_url\x18\f \x01(\tR\bimageUrl\"\x95\x02\n" + + "\x0eCatalogProduct\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x04R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12%\n" + + "\x0equotation_name\x18\x03 \x01(\tR\rquotationName\x12#\n" + + "\rcategory_name\x18\x04 \x01(\tR\fcategoryName\x12(\n" + + "\x10root_category_id\x18\x05 \x01(\x04R\x0erootCategoryId\x12,\n" + + "\x12root_category_name\x18\x06 \x01(\tR\x10rootCategoryName\x12;\n" + + "\x04skus\x18\a \x03(\v2'.lightcore.shop.crm_agent.v1.CatalogSkuR\x04skus\"\xc7\x01\n" + + "\x14CatalogSearchRequest\x12\x18\n" + + "\akeyword\x18\x01 \x01(\tR\akeyword\x12\x1f\n" + + "\vcategory_id\x18\x02 \x01(\x04R\n" + + "categoryId\x12(\n" + + "\x10root_category_id\x18\x03 \x01(\x04R\x0erootCategoryId\x12\x19\n" + + "\bbrand_id\x18\x04 \x01(\x04R\abrandId\x12\x12\n" + + "\x04page\x18\x05 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x06 \x01(\x05R\bpageSize\"\xe0\x01\n" + + "\x15CatalogSearchResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12G\n" + + "\bproducts\x18\x02 \x03(\v2+.lightcore.shop.crm_agent.v1.CatalogProductR\bproducts\x129\n" + + "\x04page\x18\x03 \x01(\v2%.lightcore.shop.crm_agent.v1.PageInfoR\x04page\"\xfa\x01\n" + + "\vEditSession\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\x12\x1f\n" + + "\vartifact_id\x18\x03 \x01(\x04R\n" + + "artifactId\x12#\n" + + "\rbase_revision\x18\x04 \x01(\x05R\fbaseRevision\x12\x1d\n" + + "\n" + + "expires_at\x18\x05 \x01(\x03R\texpiresAt\x12D\n" + + "\tquotation\x18\x06 \x01(\v2&.lightcore.shop.crm_agent.v1.QuotationR\tquotation\"\x84\x01\n" + + "\x19QuotationEditBeginRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12!\n" + + "\fquotation_id\x18\x02 \x01(\x04R\vquotationId\"\x9e\x01\n" + + "\x13EditSessionResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12B\n" + + "\asession\x18\x02 \x01(\v2(.lightcore.shop.crm_agent.v1.EditSessionR\asession\"D\n" + + "\bAddFloor\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05index\x18\x03 \x01(\x05R\x05index\"<\n" + + "\vRenameFloor\x12\x19\n" + + "\bfloor_id\x18\x01 \x01(\tR\afloorId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"?\n" + + "\fReorderFloor\x12\x19\n" + + "\bfloor_id\x18\x01 \x01(\tR\afloorId\x12\x14\n" + + "\x05index\x18\x02 \x01(\x05R\x05index\"B\n" + + "\vRemoveFloor\x12\x19\n" + + "\bfloor_id\x18\x01 \x01(\tR\afloorId\x12\x18\n" + + "\acascade\x18\x02 \x01(\bR\acascade\"_\n" + + "\bAddSpace\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" + + "\bfloor_id\x18\x02 \x01(\tR\afloorId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" + + "\x05index\x18\x04 \x01(\x05R\x05index\"<\n" + + "\vRenameSpace\x12\x19\n" + + "\bspace_id\x18\x01 \x01(\tR\aspaceId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"d\n" + + "\tMoveSpace\x12\x19\n" + + "\bspace_id\x18\x01 \x01(\tR\aspaceId\x12&\n" + + "\x0ftarget_floor_id\x18\x02 \x01(\tR\rtargetFloorId\x12\x14\n" + + "\x05index\x18\x03 \x01(\x05R\x05index\"?\n" + + "\fReorderSpace\x12\x19\n" + + "\bspace_id\x18\x01 \x01(\tR\aspaceId\x12\x14\n" + + "\x05index\x18\x02 \x01(\x05R\x05index\"B\n" + + "\vRemoveSpace\x12\x19\n" + + "\bspace_id\x18\x01 \x01(\tR\aspaceId\x12\x18\n" + + "\acascade\x18\x02 \x01(\bR\acascade\"\xb4\x01\n" + + "\vAddCategory\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" + + "\bfloor_id\x18\x02 \x01(\tR\afloorId\x12\x19\n" + + "\bspace_id\x18\x03 \x01(\tR\aspaceId\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x16\n" + + "\x06source\x18\x05 \x01(\tR\x06source\x12\x1d\n" + + "\n" + + "source_key\x18\x06 \x01(\tR\tsourceKey\x12\x14\n" + + "\x05index\x18\a \x01(\x05R\x05index\"E\n" + + "\x0eRenameCategory\x12\x1f\n" + + "\vcategory_id\x18\x01 \x01(\tR\n" + + "categoryId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"H\n" + + "\x0fReorderCategory\x12\x1f\n" + + "\vcategory_id\x18\x01 \x01(\tR\n" + + "categoryId\x12\x14\n" + + "\x05index\x18\x02 \x01(\x05R\x05index\"K\n" + + "\x0eRemoveCategory\x12\x1f\n" + + "\vcategory_id\x18\x01 \x01(\tR\n" + + "categoryId\x12\x18\n" + + "\acascade\x18\x02 \x01(\bR\acascade\"\x96\x02\n" + + "\x0eAddCatalogLine\x12\x19\n" + + "\bfloor_id\x18\x01 \x01(\tR\afloorId\x12\x19\n" + + "\bspace_id\x18\x02 \x01(\tR\aspaceId\x12\x1f\n" + + "\vcategory_id\x18\x03 \x01(\tR\n" + + "categoryId\x12\x15\n" + + "\x06sku_id\x18\x04 \x01(\x04R\x05skuId\x12\x1a\n" + + "\bquantity\x18\x05 \x01(\x01R\bquantity\x12#\n" + + "\rdiscount_rate\x18\x06 \x01(\x05R\fdiscountRate\x12'\n" + + "\x0fdiscount_amount\x18\a \x01(\x03R\x0ediscountAmount\x12\x16\n" + + "\x06remark\x18\b \x01(\tR\x06remark\x12\x14\n" + + "\x05index\x18\t \x01(\x05R\x05index\"\x86\x03\n" + + "\rAddCustomLine\x12\x19\n" + + "\bfloor_id\x18\x01 \x01(\tR\afloorId\x12\x19\n" + + "\bspace_id\x18\x02 \x01(\tR\aspaceId\x12\x1f\n" + + "\vcategory_id\x18\x03 \x01(\tR\n" + + "categoryId\x12\x1d\n" + + "\n" + + "goods_name\x18\x04 \x01(\tR\tgoodsName\x12)\n" + + "\x10spec_combination\x18\x05 \x01(\tR\x0fspecCombination\x12\x1a\n" + + "\bquantity\x18\x06 \x01(\x01R\bquantity\x12\x1d\n" + + "\n" + + "unit_price\x18\a \x01(\x03R\tunitPrice\x12\x1d\n" + + "\n" + + "cost_price\x18\b \x01(\x03R\tcostPrice\x12#\n" + + "\rdiscount_rate\x18\t \x01(\x05R\fdiscountRate\x12'\n" + + "\x0fdiscount_amount\x18\n" + + " \x01(\x03R\x0ediscountAmount\x12\x16\n" + + "\x06remark\x18\v \x01(\tR\x06remark\x12\x14\n" + + "\x05index\x18\f \x01(\x05R\x05index\"\xd7\x03\n" + + "\n" + + "UpdateLine\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\x12\"\n" + + "\n" + + "goods_name\x18\x02 \x01(\tH\x00R\tgoodsName\x88\x01\x01\x12.\n" + + "\x10spec_combination\x18\x03 \x01(\tH\x01R\x0fspecCombination\x88\x01\x01\x12\x1f\n" + + "\bquantity\x18\x04 \x01(\x01H\x02R\bquantity\x88\x01\x01\x12\"\n" + + "\n" + + "unit_price\x18\x05 \x01(\x03H\x03R\tunitPrice\x88\x01\x01\x12\"\n" + + "\n" + + "cost_price\x18\x06 \x01(\x03H\x04R\tcostPrice\x88\x01\x01\x12(\n" + + "\rdiscount_rate\x18\a \x01(\x05H\x05R\fdiscountRate\x88\x01\x01\x12,\n" + + "\x0fdiscount_amount\x18\b \x01(\x03H\x06R\x0ediscountAmount\x88\x01\x01\x12\x1b\n" + + "\x06remark\x18\t \x01(\tH\aR\x06remark\x88\x01\x01B\r\n" + + "\v_goods_nameB\x13\n" + + "\x11_spec_combinationB\v\n" + + "\t_quantityB\r\n" + + "\v_unit_priceB\r\n" + + "\v_cost_priceB\x10\n" + + "\x0e_discount_rateB\x12\n" + + "\x10_discount_amountB\t\n" + + "\a_remark\"\x90\x01\n" + + "\bMoveLine\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\x12\x19\n" + + "\bfloor_id\x18\x02 \x01(\tR\afloorId\x12\x19\n" + + "\bspace_id\x18\x03 \x01(\tR\aspaceId\x12\x1f\n" + + "\vcategory_id\x18\x04 \x01(\tR\n" + + "categoryId\x12\x14\n" + + "\x05index\x18\x05 \x01(\x05R\x05index\"<\n" + + "\vReorderLine\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\x12\x14\n" + + "\x05index\x18\x02 \x01(\x05R\x05index\"@\n" + + "\rSetLineActive\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\x12\x16\n" + + "\x06active\x18\x02 \x01(\bR\x06active\"%\n" + + "\n" + + "RemoveLine\x12\x17\n" + + "\aline_id\x18\x01 \x01(\tR\x06lineId\"\xa1\x01\n" + + "\x06AddFee\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12!\n" + + "\ffixed_amount\x18\x03 \x01(\x03R\vfixedAmount\x12\x1e\n" + + "\n" + + "percentage\x18\x04 \x01(\x05R\n" + + "percentage\x12\x14\n" + + "\x05index\x18\x05 \x01(\x05R\x05index\x12\x16\n" + + "\x06remark\x18\x06 \x01(\tR\x06remark\"\xfa\x01\n" + + "\tUpdateFee\x12\x14\n" + + "\x05index\x18\x01 \x01(\x05R\x05index\x12\x17\n" + + "\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12\x17\n" + + "\x04type\x18\x03 \x01(\tH\x01R\x04type\x88\x01\x01\x12&\n" + + "\ffixed_amount\x18\x04 \x01(\x03H\x02R\vfixedAmount\x88\x01\x01\x12#\n" + + "\n" + + "percentage\x18\x05 \x01(\x05H\x03R\n" + + "percentage\x88\x01\x01\x12\x1b\n" + + "\x06remark\x18\x06 \x01(\tH\x04R\x06remark\x88\x01\x01B\a\n" + + "\x05_nameB\a\n" + + "\x05_typeB\x0f\n" + + "\r_fixed_amountB\r\n" + + "\v_percentageB\t\n" + + "\a_remark\"E\n" + + "\n" + + "ReorderFee\x12\x14\n" + + "\x05index\x18\x01 \x01(\x05R\x05index\x12!\n" + + "\ftarget_index\x18\x02 \x01(\x05R\vtargetIndex\"!\n" + + "\tRemoveFee\x12\x14\n" + + "\x05index\x18\x01 \x01(\x05R\x05index\"\xbe\x02\n" + + "\n" + + "SetPricing\x12(\n" + + "\rdiscount_rate\x18\x01 \x01(\x05H\x00R\fdiscountRate\x88\x01\x01\x12,\n" + + "\x0fdiscount_amount\x18\x02 \x01(\x03H\x01R\x0ediscountAmount\x88\x01\x01\x12(\n" + + "\ractual_amount\x18\x03 \x01(\x03H\x02R\factualAmount\x88\x01\x01\x125\n" + + "\x14has_price_adjustment\x18\x04 \x01(\bH\x03R\x12hasPriceAdjustment\x88\x01\x01\x12\x1b\n" + + "\x06remark\x18\x05 \x01(\tH\x04R\x06remark\x88\x01\x01B\x10\n" + + "\x0e_discount_rateB\x12\n" + + "\x10_discount_amountB\x10\n" + + "\x0e_actual_amountB\x17\n" + + "\x15_has_price_adjustmentB\t\n" + + "\a_remark\"\xb5\x10\n" + + "\x1bQuotationEditCommandRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12D\n" + + "\tadd_floor\x18\n" + + " \x01(\v2%.lightcore.shop.crm_agent.v1.AddFloorH\x00R\baddFloor\x12M\n" + + "\frename_floor\x18\v \x01(\v2(.lightcore.shop.crm_agent.v1.RenameFloorH\x00R\vrenameFloor\x12P\n" + + "\rreorder_floor\x18\f \x01(\v2).lightcore.shop.crm_agent.v1.ReorderFloorH\x00R\freorderFloor\x12M\n" + + "\fremove_floor\x18\r \x01(\v2(.lightcore.shop.crm_agent.v1.RemoveFloorH\x00R\vremoveFloor\x12D\n" + + "\tadd_space\x18\x0e \x01(\v2%.lightcore.shop.crm_agent.v1.AddSpaceH\x00R\baddSpace\x12M\n" + + "\frename_space\x18\x0f \x01(\v2(.lightcore.shop.crm_agent.v1.RenameSpaceH\x00R\vrenameSpace\x12G\n" + + "\n" + + "move_space\x18\x10 \x01(\v2&.lightcore.shop.crm_agent.v1.MoveSpaceH\x00R\tmoveSpace\x12P\n" + + "\rreorder_space\x18\x11 \x01(\v2).lightcore.shop.crm_agent.v1.ReorderSpaceH\x00R\freorderSpace\x12M\n" + + "\fremove_space\x18\x12 \x01(\v2(.lightcore.shop.crm_agent.v1.RemoveSpaceH\x00R\vremoveSpace\x12M\n" + + "\fadd_category\x18\x13 \x01(\v2(.lightcore.shop.crm_agent.v1.AddCategoryH\x00R\vaddCategory\x12V\n" + + "\x0frename_category\x18\x14 \x01(\v2+.lightcore.shop.crm_agent.v1.RenameCategoryH\x00R\x0erenameCategory\x12Y\n" + + "\x10reorder_category\x18\x15 \x01(\v2,.lightcore.shop.crm_agent.v1.ReorderCategoryH\x00R\x0freorderCategory\x12V\n" + + "\x0fremove_category\x18\x16 \x01(\v2+.lightcore.shop.crm_agent.v1.RemoveCategoryH\x00R\x0eremoveCategory\x12W\n" + + "\x10add_catalog_line\x18\x17 \x01(\v2+.lightcore.shop.crm_agent.v1.AddCatalogLineH\x00R\x0eaddCatalogLine\x12T\n" + + "\x0fadd_custom_line\x18\x18 \x01(\v2*.lightcore.shop.crm_agent.v1.AddCustomLineH\x00R\raddCustomLine\x12J\n" + + "\vupdate_line\x18\x19 \x01(\v2'.lightcore.shop.crm_agent.v1.UpdateLineH\x00R\n" + + "updateLine\x12D\n" + + "\tmove_line\x18\x1a \x01(\v2%.lightcore.shop.crm_agent.v1.MoveLineH\x00R\bmoveLine\x12M\n" + + "\freorder_line\x18\x1b \x01(\v2(.lightcore.shop.crm_agent.v1.ReorderLineH\x00R\vreorderLine\x12T\n" + + "\x0fset_line_active\x18\x1c \x01(\v2*.lightcore.shop.crm_agent.v1.SetLineActiveH\x00R\rsetLineActive\x12J\n" + + "\vremove_line\x18\x1d \x01(\v2'.lightcore.shop.crm_agent.v1.RemoveLineH\x00R\n" + + "removeLine\x12>\n" + + "\aadd_fee\x18\x1e \x01(\v2#.lightcore.shop.crm_agent.v1.AddFeeH\x00R\x06addFee\x12G\n" + + "\n" + + "update_fee\x18\x1f \x01(\v2&.lightcore.shop.crm_agent.v1.UpdateFeeH\x00R\tupdateFee\x12J\n" + + "\vreorder_fee\x18 \x01(\v2'.lightcore.shop.crm_agent.v1.ReorderFeeH\x00R\n" + + "reorderFee\x12G\n" + + "\n" + + "remove_fee\x18! \x01(\v2&.lightcore.shop.crm_agent.v1.RemoveFeeH\x00R\tremoveFee\x12J\n" + + "\vset_pricing\x18\" \x01(\v2'.lightcore.shop.crm_agent.v1.SetPricingH\x00R\n" + + "setPricingB\x06\n" + + "\x04edit\"\xd3\x01\n" + + "\x1cQuotationEditCommandResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12B\n" + + "\asession\x18\x02 \x01(\v2(.lightcore.shop.crm_agent.v1.EditSessionR\asession\x12*\n" + + "\x11affected_line_ids\x18\x03 \x03(\tR\x0faffectedLineIds\"<\n" + + "\x1bQuotationEditPreviewRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\"\x88\x02\n" + + "\x1cQuotationEditPreviewResponse\x12C\n" + + "\x06header\x18\x01 \x01(\v2+.lightcore.shop.crm_agent.v1.ResponseHeaderR\x06header\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x1a\n" + + "\brevision\x18\x03 \x01(\x05R\brevision\x12\"\n" + + "\rchange_set_id\x18\x04 \x01(\tR\vchangeSetId\x12D\n" + + "\tquotation\x18\x05 \x01(\v2&.lightcore.shop.crm_agent.v1.QuotationR\tquotation\"\xc1\x01\n" + + "\x1aQuotationEditCommitRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x1a\n" + + "\brevision\x18\x03 \x01(\x05R\brevision\x12\"\n" + + "\rchange_set_id\x18\x04 \x01(\tR\vchangeSetId\"\x82\x01\n" + + "\x1bQuotationEditDiscardRequest\x12D\n" + + "\acommand\x18\x01 \x01(\v2*.lightcore.shop.crm_agent.v1.CommandHeaderR\acommand\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionIdB;Z9light/application/shop/interfaces/crm_agent_proto/dto;dtob\x06proto3" + +var ( + file_shop_crm_agent_proto_rawDescOnce sync.Once + file_shop_crm_agent_proto_rawDescData []byte +) + +func file_shop_crm_agent_proto_rawDescGZIP() []byte { + file_shop_crm_agent_proto_rawDescOnce.Do(func() { + file_shop_crm_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_shop_crm_agent_proto_rawDesc), len(file_shop_crm_agent_proto_rawDesc))) + }) + return file_shop_crm_agent_proto_rawDescData +} + +var file_shop_crm_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 75) +var file_shop_crm_agent_proto_goTypes = []any{ + (*ResponseHeader)(nil), // 0: lightcore.shop.crm_agent.v1.ResponseHeader + (*CommandHeader)(nil), // 1: lightcore.shop.crm_agent.v1.CommandHeader + (*CommonResponse)(nil), // 2: lightcore.shop.crm_agent.v1.CommonResponse + (*PageInfo)(nil), // 3: lightcore.shop.crm_agent.v1.PageInfo + (*Customer)(nil), // 4: lightcore.shop.crm_agent.v1.Customer + (*CustomerListRequest)(nil), // 5: lightcore.shop.crm_agent.v1.CustomerListRequest + (*CustomerListResponse)(nil), // 6: lightcore.shop.crm_agent.v1.CustomerListResponse + (*Project)(nil), // 7: lightcore.shop.crm_agent.v1.Project + (*ProjectListRequest)(nil), // 8: lightcore.shop.crm_agent.v1.ProjectListRequest + (*ProjectListResponse)(nil), // 9: lightcore.shop.crm_agent.v1.ProjectListResponse + (*ProjectGetRequest)(nil), // 10: lightcore.shop.crm_agent.v1.ProjectGetRequest + (*ProjectResponse)(nil), // 11: lightcore.shop.crm_agent.v1.ProjectResponse + (*ProjectCreateRequest)(nil), // 12: lightcore.shop.crm_agent.v1.ProjectCreateRequest + (*ProjectUpdateRequest)(nil), // 13: lightcore.shop.crm_agent.v1.ProjectUpdateRequest + (*ProjectStatusRequest)(nil), // 14: lightcore.shop.crm_agent.v1.ProjectStatusRequest + (*ProjectDeletePreviewRequest)(nil), // 15: lightcore.shop.crm_agent.v1.ProjectDeletePreviewRequest + (*DeletePreview)(nil), // 16: lightcore.shop.crm_agent.v1.DeletePreview + (*DeletePreviewResponse)(nil), // 17: lightcore.shop.crm_agent.v1.DeletePreviewResponse + (*ProjectDeleteRequest)(nil), // 18: lightcore.shop.crm_agent.v1.ProjectDeleteRequest + (*QuotationSummary)(nil), // 19: lightcore.shop.crm_agent.v1.QuotationSummary + (*QuotationCategory)(nil), // 20: lightcore.shop.crm_agent.v1.QuotationCategory + (*QuotationSpace)(nil), // 21: lightcore.shop.crm_agent.v1.QuotationSpace + (*QuotationFloor)(nil), // 22: lightcore.shop.crm_agent.v1.QuotationFloor + (*QuotationLine)(nil), // 23: lightcore.shop.crm_agent.v1.QuotationLine + (*QuotationFee)(nil), // 24: lightcore.shop.crm_agent.v1.QuotationFee + (*Quotation)(nil), // 25: lightcore.shop.crm_agent.v1.Quotation + (*QuotationListRequest)(nil), // 26: lightcore.shop.crm_agent.v1.QuotationListRequest + (*QuotationListResponse)(nil), // 27: lightcore.shop.crm_agent.v1.QuotationListResponse + (*QuotationGetRequest)(nil), // 28: lightcore.shop.crm_agent.v1.QuotationGetRequest + (*QuotationResponse)(nil), // 29: lightcore.shop.crm_agent.v1.QuotationResponse + (*QuotationCreateRequest)(nil), // 30: lightcore.shop.crm_agent.v1.QuotationCreateRequest + (*QuotationCopyRequest)(nil), // 31: lightcore.shop.crm_agent.v1.QuotationCopyRequest + (*QuotationTitleRequest)(nil), // 32: lightcore.shop.crm_agent.v1.QuotationTitleRequest + (*QuotationStatusRequest)(nil), // 33: lightcore.shop.crm_agent.v1.QuotationStatusRequest + (*QuotationLockRequest)(nil), // 34: lightcore.shop.crm_agent.v1.QuotationLockRequest + (*QuotationDeletePreviewRequest)(nil), // 35: lightcore.shop.crm_agent.v1.QuotationDeletePreviewRequest + (*QuotationDeleteRequest)(nil), // 36: lightcore.shop.crm_agent.v1.QuotationDeleteRequest + (*CatalogSku)(nil), // 37: lightcore.shop.crm_agent.v1.CatalogSku + (*CatalogProduct)(nil), // 38: lightcore.shop.crm_agent.v1.CatalogProduct + (*CatalogSearchRequest)(nil), // 39: lightcore.shop.crm_agent.v1.CatalogSearchRequest + (*CatalogSearchResponse)(nil), // 40: lightcore.shop.crm_agent.v1.CatalogSearchResponse + (*EditSession)(nil), // 41: lightcore.shop.crm_agent.v1.EditSession + (*QuotationEditBeginRequest)(nil), // 42: lightcore.shop.crm_agent.v1.QuotationEditBeginRequest + (*EditSessionResponse)(nil), // 43: lightcore.shop.crm_agent.v1.EditSessionResponse + (*AddFloor)(nil), // 44: lightcore.shop.crm_agent.v1.AddFloor + (*RenameFloor)(nil), // 45: lightcore.shop.crm_agent.v1.RenameFloor + (*ReorderFloor)(nil), // 46: lightcore.shop.crm_agent.v1.ReorderFloor + (*RemoveFloor)(nil), // 47: lightcore.shop.crm_agent.v1.RemoveFloor + (*AddSpace)(nil), // 48: lightcore.shop.crm_agent.v1.AddSpace + (*RenameSpace)(nil), // 49: lightcore.shop.crm_agent.v1.RenameSpace + (*MoveSpace)(nil), // 50: lightcore.shop.crm_agent.v1.MoveSpace + (*ReorderSpace)(nil), // 51: lightcore.shop.crm_agent.v1.ReorderSpace + (*RemoveSpace)(nil), // 52: lightcore.shop.crm_agent.v1.RemoveSpace + (*AddCategory)(nil), // 53: lightcore.shop.crm_agent.v1.AddCategory + (*RenameCategory)(nil), // 54: lightcore.shop.crm_agent.v1.RenameCategory + (*ReorderCategory)(nil), // 55: lightcore.shop.crm_agent.v1.ReorderCategory + (*RemoveCategory)(nil), // 56: lightcore.shop.crm_agent.v1.RemoveCategory + (*AddCatalogLine)(nil), // 57: lightcore.shop.crm_agent.v1.AddCatalogLine + (*AddCustomLine)(nil), // 58: lightcore.shop.crm_agent.v1.AddCustomLine + (*UpdateLine)(nil), // 59: lightcore.shop.crm_agent.v1.UpdateLine + (*MoveLine)(nil), // 60: lightcore.shop.crm_agent.v1.MoveLine + (*ReorderLine)(nil), // 61: lightcore.shop.crm_agent.v1.ReorderLine + (*SetLineActive)(nil), // 62: lightcore.shop.crm_agent.v1.SetLineActive + (*RemoveLine)(nil), // 63: lightcore.shop.crm_agent.v1.RemoveLine + (*AddFee)(nil), // 64: lightcore.shop.crm_agent.v1.AddFee + (*UpdateFee)(nil), // 65: lightcore.shop.crm_agent.v1.UpdateFee + (*ReorderFee)(nil), // 66: lightcore.shop.crm_agent.v1.ReorderFee + (*RemoveFee)(nil), // 67: lightcore.shop.crm_agent.v1.RemoveFee + (*SetPricing)(nil), // 68: lightcore.shop.crm_agent.v1.SetPricing + (*QuotationEditCommandRequest)(nil), // 69: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest + (*QuotationEditCommandResponse)(nil), // 70: lightcore.shop.crm_agent.v1.QuotationEditCommandResponse + (*QuotationEditPreviewRequest)(nil), // 71: lightcore.shop.crm_agent.v1.QuotationEditPreviewRequest + (*QuotationEditPreviewResponse)(nil), // 72: lightcore.shop.crm_agent.v1.QuotationEditPreviewResponse + (*QuotationEditCommitRequest)(nil), // 73: lightcore.shop.crm_agent.v1.QuotationEditCommitRequest + (*QuotationEditDiscardRequest)(nil), // 74: lightcore.shop.crm_agent.v1.QuotationEditDiscardRequest +} +var file_shop_crm_agent_proto_depIdxs = []int32{ + 0, // 0: lightcore.shop.crm_agent.v1.CommonResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 0, // 1: lightcore.shop.crm_agent.v1.CustomerListResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 4, // 2: lightcore.shop.crm_agent.v1.CustomerListResponse.customers:type_name -> lightcore.shop.crm_agent.v1.Customer + 3, // 3: lightcore.shop.crm_agent.v1.CustomerListResponse.page:type_name -> lightcore.shop.crm_agent.v1.PageInfo + 0, // 4: lightcore.shop.crm_agent.v1.ProjectListResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 7, // 5: lightcore.shop.crm_agent.v1.ProjectListResponse.projects:type_name -> lightcore.shop.crm_agent.v1.Project + 3, // 6: lightcore.shop.crm_agent.v1.ProjectListResponse.page:type_name -> lightcore.shop.crm_agent.v1.PageInfo + 0, // 7: lightcore.shop.crm_agent.v1.ProjectResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 7, // 8: lightcore.shop.crm_agent.v1.ProjectResponse.project:type_name -> lightcore.shop.crm_agent.v1.Project + 1, // 9: lightcore.shop.crm_agent.v1.ProjectCreateRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 10: lightcore.shop.crm_agent.v1.ProjectUpdateRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 11: lightcore.shop.crm_agent.v1.ProjectStatusRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 0, // 12: lightcore.shop.crm_agent.v1.DeletePreviewResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 16, // 13: lightcore.shop.crm_agent.v1.DeletePreviewResponse.preview:type_name -> lightcore.shop.crm_agent.v1.DeletePreview + 1, // 14: lightcore.shop.crm_agent.v1.ProjectDeleteRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 20, // 15: lightcore.shop.crm_agent.v1.QuotationSpace.categories:type_name -> lightcore.shop.crm_agent.v1.QuotationCategory + 21, // 16: lightcore.shop.crm_agent.v1.QuotationFloor.spaces:type_name -> lightcore.shop.crm_agent.v1.QuotationSpace + 19, // 17: lightcore.shop.crm_agent.v1.Quotation.summary:type_name -> lightcore.shop.crm_agent.v1.QuotationSummary + 22, // 18: lightcore.shop.crm_agent.v1.Quotation.floors:type_name -> lightcore.shop.crm_agent.v1.QuotationFloor + 23, // 19: lightcore.shop.crm_agent.v1.Quotation.lines:type_name -> lightcore.shop.crm_agent.v1.QuotationLine + 24, // 20: lightcore.shop.crm_agent.v1.Quotation.fees:type_name -> lightcore.shop.crm_agent.v1.QuotationFee + 0, // 21: lightcore.shop.crm_agent.v1.QuotationListResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 19, // 22: lightcore.shop.crm_agent.v1.QuotationListResponse.quotations:type_name -> lightcore.shop.crm_agent.v1.QuotationSummary + 3, // 23: lightcore.shop.crm_agent.v1.QuotationListResponse.page:type_name -> lightcore.shop.crm_agent.v1.PageInfo + 0, // 24: lightcore.shop.crm_agent.v1.QuotationResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 25, // 25: lightcore.shop.crm_agent.v1.QuotationResponse.quotation:type_name -> lightcore.shop.crm_agent.v1.Quotation + 1, // 26: lightcore.shop.crm_agent.v1.QuotationCreateRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 27: lightcore.shop.crm_agent.v1.QuotationCopyRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 28: lightcore.shop.crm_agent.v1.QuotationTitleRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 29: lightcore.shop.crm_agent.v1.QuotationStatusRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 30: lightcore.shop.crm_agent.v1.QuotationLockRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 31: lightcore.shop.crm_agent.v1.QuotationDeleteRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 37, // 32: lightcore.shop.crm_agent.v1.CatalogProduct.skus:type_name -> lightcore.shop.crm_agent.v1.CatalogSku + 0, // 33: lightcore.shop.crm_agent.v1.CatalogSearchResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 38, // 34: lightcore.shop.crm_agent.v1.CatalogSearchResponse.products:type_name -> lightcore.shop.crm_agent.v1.CatalogProduct + 3, // 35: lightcore.shop.crm_agent.v1.CatalogSearchResponse.page:type_name -> lightcore.shop.crm_agent.v1.PageInfo + 25, // 36: lightcore.shop.crm_agent.v1.EditSession.quotation:type_name -> lightcore.shop.crm_agent.v1.Quotation + 1, // 37: lightcore.shop.crm_agent.v1.QuotationEditBeginRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 0, // 38: lightcore.shop.crm_agent.v1.EditSessionResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 41, // 39: lightcore.shop.crm_agent.v1.EditSessionResponse.session:type_name -> lightcore.shop.crm_agent.v1.EditSession + 1, // 40: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 44, // 41: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_floor:type_name -> lightcore.shop.crm_agent.v1.AddFloor + 45, // 42: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.rename_floor:type_name -> lightcore.shop.crm_agent.v1.RenameFloor + 46, // 43: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.reorder_floor:type_name -> lightcore.shop.crm_agent.v1.ReorderFloor + 47, // 44: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.remove_floor:type_name -> lightcore.shop.crm_agent.v1.RemoveFloor + 48, // 45: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_space:type_name -> lightcore.shop.crm_agent.v1.AddSpace + 49, // 46: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.rename_space:type_name -> lightcore.shop.crm_agent.v1.RenameSpace + 50, // 47: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.move_space:type_name -> lightcore.shop.crm_agent.v1.MoveSpace + 51, // 48: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.reorder_space:type_name -> lightcore.shop.crm_agent.v1.ReorderSpace + 52, // 49: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.remove_space:type_name -> lightcore.shop.crm_agent.v1.RemoveSpace + 53, // 50: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_category:type_name -> lightcore.shop.crm_agent.v1.AddCategory + 54, // 51: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.rename_category:type_name -> lightcore.shop.crm_agent.v1.RenameCategory + 55, // 52: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.reorder_category:type_name -> lightcore.shop.crm_agent.v1.ReorderCategory + 56, // 53: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.remove_category:type_name -> lightcore.shop.crm_agent.v1.RemoveCategory + 57, // 54: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_catalog_line:type_name -> lightcore.shop.crm_agent.v1.AddCatalogLine + 58, // 55: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_custom_line:type_name -> lightcore.shop.crm_agent.v1.AddCustomLine + 59, // 56: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.update_line:type_name -> lightcore.shop.crm_agent.v1.UpdateLine + 60, // 57: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.move_line:type_name -> lightcore.shop.crm_agent.v1.MoveLine + 61, // 58: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.reorder_line:type_name -> lightcore.shop.crm_agent.v1.ReorderLine + 62, // 59: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.set_line_active:type_name -> lightcore.shop.crm_agent.v1.SetLineActive + 63, // 60: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.remove_line:type_name -> lightcore.shop.crm_agent.v1.RemoveLine + 64, // 61: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.add_fee:type_name -> lightcore.shop.crm_agent.v1.AddFee + 65, // 62: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.update_fee:type_name -> lightcore.shop.crm_agent.v1.UpdateFee + 66, // 63: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.reorder_fee:type_name -> lightcore.shop.crm_agent.v1.ReorderFee + 67, // 64: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.remove_fee:type_name -> lightcore.shop.crm_agent.v1.RemoveFee + 68, // 65: lightcore.shop.crm_agent.v1.QuotationEditCommandRequest.set_pricing:type_name -> lightcore.shop.crm_agent.v1.SetPricing + 0, // 66: lightcore.shop.crm_agent.v1.QuotationEditCommandResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 41, // 67: lightcore.shop.crm_agent.v1.QuotationEditCommandResponse.session:type_name -> lightcore.shop.crm_agent.v1.EditSession + 0, // 68: lightcore.shop.crm_agent.v1.QuotationEditPreviewResponse.header:type_name -> lightcore.shop.crm_agent.v1.ResponseHeader + 25, // 69: lightcore.shop.crm_agent.v1.QuotationEditPreviewResponse.quotation:type_name -> lightcore.shop.crm_agent.v1.Quotation + 1, // 70: lightcore.shop.crm_agent.v1.QuotationEditCommitRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 1, // 71: lightcore.shop.crm_agent.v1.QuotationEditDiscardRequest.command:type_name -> lightcore.shop.crm_agent.v1.CommandHeader + 72, // [72:72] is the sub-list for method output_type + 72, // [72:72] is the sub-list for method input_type + 72, // [72:72] is the sub-list for extension type_name + 72, // [72:72] is the sub-list for extension extendee + 0, // [0:72] is the sub-list for field type_name +} + +func init() { file_shop_crm_agent_proto_init() } +func file_shop_crm_agent_proto_init() { + if File_shop_crm_agent_proto != nil { + return + } + file_shop_crm_agent_proto_msgTypes[13].OneofWrappers = []any{} + file_shop_crm_agent_proto_msgTypes[59].OneofWrappers = []any{} + file_shop_crm_agent_proto_msgTypes[65].OneofWrappers = []any{} + file_shop_crm_agent_proto_msgTypes[68].OneofWrappers = []any{} + file_shop_crm_agent_proto_msgTypes[69].OneofWrappers = []any{ + (*QuotationEditCommandRequest_AddFloor)(nil), + (*QuotationEditCommandRequest_RenameFloor)(nil), + (*QuotationEditCommandRequest_ReorderFloor)(nil), + (*QuotationEditCommandRequest_RemoveFloor)(nil), + (*QuotationEditCommandRequest_AddSpace)(nil), + (*QuotationEditCommandRequest_RenameSpace)(nil), + (*QuotationEditCommandRequest_MoveSpace)(nil), + (*QuotationEditCommandRequest_ReorderSpace)(nil), + (*QuotationEditCommandRequest_RemoveSpace)(nil), + (*QuotationEditCommandRequest_AddCategory)(nil), + (*QuotationEditCommandRequest_RenameCategory)(nil), + (*QuotationEditCommandRequest_ReorderCategory)(nil), + (*QuotationEditCommandRequest_RemoveCategory)(nil), + (*QuotationEditCommandRequest_AddCatalogLine)(nil), + (*QuotationEditCommandRequest_AddCustomLine)(nil), + (*QuotationEditCommandRequest_UpdateLine)(nil), + (*QuotationEditCommandRequest_MoveLine)(nil), + (*QuotationEditCommandRequest_ReorderLine)(nil), + (*QuotationEditCommandRequest_SetLineActive)(nil), + (*QuotationEditCommandRequest_RemoveLine)(nil), + (*QuotationEditCommandRequest_AddFee)(nil), + (*QuotationEditCommandRequest_UpdateFee)(nil), + (*QuotationEditCommandRequest_ReorderFee)(nil), + (*QuotationEditCommandRequest_RemoveFee)(nil), + (*QuotationEditCommandRequest_SetPricing)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_shop_crm_agent_proto_rawDesc), len(file_shop_crm_agent_proto_rawDesc)), + NumEnums: 0, + NumMessages: 75, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_shop_crm_agent_proto_goTypes, + DependencyIndexes: file_shop_crm_agent_proto_depIdxs, + MessageInfos: file_shop_crm_agent_proto_msgTypes, + }.Build() + File_shop_crm_agent_proto = out.File + file_shop_crm_agent_proto_goTypes = nil + file_shop_crm_agent_proto_depIdxs = nil +} diff --git a/internal/client/client.go b/internal/client/client.go new file mode 100644 index 0000000..31932be --- /dev/null +++ b/internal/client/client.go @@ -0,0 +1,166 @@ +package client + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + api "code.zhecent.com/open/shop-crm-agent/internal/api" + + "google.golang.org/protobuf/proto" +) + +const ( + apiPath = "/api/shop/crm-agent/v1" + maxResponseSize = 16 << 20 +) + +type Client struct { + baseURL string + token string + httpClient *http.Client +} + +func New(baseURL, token string, httpClient *http.Client) (*Client, error) { + baseURL = strings.TrimRight(strings.TrimSpace(baseURL), "/") + parsed, err := url.Parse(baseURL) + if err != nil || parsed.Host == "" || (parsed.Scheme != "http" && parsed.Scheme != "https") { + return nil, errors.New("LIGHTCORE_API_BASE_URL 必须是有效的 http/https URL") + } + if strings.TrimSpace(token) == "" { + return nil, errors.New("LIGHTCORE_SHOP_CRM_AGENT_TOKEN 不能为空") + } + if httpClient == nil { + httpClient = &http.Client{Timeout: 30 * time.Second} + } + return &Client{baseURL: baseURL, token: strings.TrimSpace(token), httpClient: httpClient}, nil +} + +type responseWithHeader interface { + proto.Message + GetHeader() *api.ResponseHeader +} + +func doRequest[Req proto.Message, Resp responseWithHeader](ctx context.Context, client *Client, path string, request Req, response Resp) (Resp, error) { + data, err := proto.Marshal(request) + if err != nil { + return response, fmt.Errorf("编码 Protobuf 请求失败: %w", err) + } + httpRequest, err := http.NewRequestWithContext(ctx, http.MethodPost, client.baseURL+apiPath+path, bytes.NewReader(data)) + if err != nil { + return response, err + } + httpRequest.Header.Set("Content-Type", "application/x-protobuf") + httpRequest.Header.Set("Accept", "application/x-protobuf") + httpRequest.Header.Set("Authorization", "Bearer "+client.token) + httpResponse, err := client.httpClient.Do(httpRequest) + if err != nil { + return response, err + } + defer httpResponse.Body.Close() + body, err := io.ReadAll(io.LimitReader(httpResponse.Body, maxResponseSize+1)) + if err != nil { + return response, err + } + if len(body) > maxResponseSize { + return response, errors.New("CRM Agent API 响应超过16 MiB限制") + } + if err := proto.Unmarshal(body, response); err != nil { + return response, fmt.Errorf("解析 Protobuf 响应失败(HTTP %d): %w", httpResponse.StatusCode, err) + } + header := response.GetHeader() + if httpResponse.StatusCode < 200 || httpResponse.StatusCode >= 300 { + if header != nil && header.Message != "" { + return response, fmt.Errorf("CRM Agent API HTTP %d: %s", httpResponse.StatusCode, header.Message) + } + return response, fmt.Errorf("CRM Agent API HTTP %d", httpResponse.StatusCode) + } + if header == nil { + return response, errors.New("CRM Agent API 响应缺少 ResponseHeader") + } + if header.Code != 200 { + return response, fmt.Errorf("CRM Agent API 错误 %d: %s", header.Code, header.Message) + } + return response, nil +} + +func (c *Client) CustomerList(ctx context.Context, req *api.CustomerListRequest) (*api.CustomerListResponse, error) { + return doRequest(ctx, c, "/customers/list", req, &api.CustomerListResponse{}) +} +func (c *Client) ProjectList(ctx context.Context, req *api.ProjectListRequest) (*api.ProjectListResponse, error) { + return doRequest(ctx, c, "/projects/list", req, &api.ProjectListResponse{}) +} +func (c *Client) ProjectGet(ctx context.Context, req *api.ProjectGetRequest) (*api.ProjectResponse, error) { + return doRequest(ctx, c, "/projects/get", req, &api.ProjectResponse{}) +} +func (c *Client) ProjectCreate(ctx context.Context, req *api.ProjectCreateRequest) (*api.ProjectResponse, error) { + return doRequest(ctx, c, "/projects/create", req, &api.ProjectResponse{}) +} +func (c *Client) ProjectUpdate(ctx context.Context, req *api.ProjectUpdateRequest) (*api.ProjectResponse, error) { + return doRequest(ctx, c, "/projects/update", req, &api.ProjectResponse{}) +} +func (c *Client) ProjectStatus(ctx context.Context, req *api.ProjectStatusRequest) (*api.ProjectResponse, error) { + return doRequest(ctx, c, "/projects/status", req, &api.ProjectResponse{}) +} +func (c *Client) ProjectDeletePreview(ctx context.Context, req *api.ProjectDeletePreviewRequest) (*api.DeletePreviewResponse, error) { + return doRequest(ctx, c, "/projects/delete/preview", req, &api.DeletePreviewResponse{}) +} +func (c *Client) ProjectDelete(ctx context.Context, req *api.ProjectDeleteRequest) (*api.DeletePreviewResponse, error) { + return doRequest(ctx, c, "/projects/delete", req, &api.DeletePreviewResponse{}) +} + +func (c *Client) QuotationList(ctx context.Context, req *api.QuotationListRequest) (*api.QuotationListResponse, error) { + return doRequest(ctx, c, "/quotations/list", req, &api.QuotationListResponse{}) +} +func (c *Client) QuotationGet(ctx context.Context, req *api.QuotationGetRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/get", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationCreate(ctx context.Context, req *api.QuotationCreateRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/create", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationCopy(ctx context.Context, req *api.QuotationCopyRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/copy", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationTitle(ctx context.Context, req *api.QuotationTitleRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/title", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationStatus(ctx context.Context, req *api.QuotationStatusRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/status", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationLock(ctx context.Context, req *api.QuotationLockRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/lock", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationUnlock(ctx context.Context, req *api.QuotationLockRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotations/unlock", req, &api.QuotationResponse{}) +} +func (c *Client) QuotationDeletePreview(ctx context.Context, req *api.QuotationDeletePreviewRequest) (*api.DeletePreviewResponse, error) { + return doRequest(ctx, c, "/quotations/delete/preview", req, &api.DeletePreviewResponse{}) +} +func (c *Client) QuotationDelete(ctx context.Context, req *api.QuotationDeleteRequest) (*api.DeletePreviewResponse, error) { + return doRequest(ctx, c, "/quotations/delete", req, &api.DeletePreviewResponse{}) +} +func (c *Client) CatalogSearch(ctx context.Context, req *api.CatalogSearchRequest) (*api.CatalogSearchResponse, error) { + return doRequest(ctx, c, "/catalog/search", req, &api.CatalogSearchResponse{}) +} + +func (c *Client) EditBegin(ctx context.Context, req *api.QuotationEditBeginRequest) (*api.EditSessionResponse, error) { + return doRequest(ctx, c, "/quotation/edit/begin", req, &api.EditSessionResponse{}) +} +func (c *Client) EditCommand(ctx context.Context, req *api.QuotationEditCommandRequest) (*api.QuotationEditCommandResponse, error) { + return doRequest(ctx, c, "/quotation/edit/command", req, &api.QuotationEditCommandResponse{}) +} +func (c *Client) EditPreview(ctx context.Context, req *api.QuotationEditPreviewRequest) (*api.QuotationEditPreviewResponse, error) { + return doRequest(ctx, c, "/quotation/edit/preview", req, &api.QuotationEditPreviewResponse{}) +} +func (c *Client) EditCommit(ctx context.Context, req *api.QuotationEditCommitRequest) (*api.QuotationResponse, error) { + return doRequest(ctx, c, "/quotation/edit/commit", req, &api.QuotationResponse{}) +} +func (c *Client) EditDiscard(ctx context.Context, req *api.QuotationEditDiscardRequest) (*api.EditSessionResponse, error) { + return doRequest(ctx, c, "/quotation/edit/discard", req, &api.EditSessionResponse{}) +} diff --git a/internal/client/client_test.go b/internal/client/client_test.go new file mode 100644 index 0000000..876b0e4 --- /dev/null +++ b/internal/client/client_test.go @@ -0,0 +1,156 @@ +package client + +import ( + "context" + "errors" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + api "code.zhecent.com/open/shop-crm-agent/internal/api" + + "google.golang.org/protobuf/proto" +) + +func TestClientSendsBearerProtobufAndChecksBusinessHeader(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + if request.URL.Path != apiPath+"/projects/get" { + t.Errorf("path = %s", request.URL.Path) + } + if request.Header.Get("Authorization") != "Bearer test-token" { + t.Errorf("authorization = %q", request.Header.Get("Authorization")) + } + if request.Header.Get("Content-Type") != "application/x-protobuf" { + t.Errorf("content type = %q", request.Header.Get("Content-Type")) + } + data, _ := proto.Marshal(&api.ProjectResponse{Header: &api.ResponseHeader{Code: 200, Message: "success"}, Project: &api.Project{Id: 9}}) + writer.Header().Set("Content-Type", "application/x-protobuf") + _, _ = writer.Write(data) + })) + defer server.Close() + client, err := New(server.URL, "test-token", server.Client()) + if err != nil { + t.Fatalf("new client: %v", err) + } + response, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{ProjectId: 9}) + if err != nil { + t.Fatalf("project get: %v", err) + } + if response.Project.GetId() != 9 { + t.Fatalf("project id = %d", response.Project.GetId()) + } +} + +func TestClientReportsHTTPProtocolAndSizeFailures(t *testing.T) { + t.Run("http error preserves protobuf header", func(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(http.StatusUnauthorized) + data, _ := proto.Marshal(&api.ProjectResponse{Header: &api.ResponseHeader{Code: 401, Message: "unauthorized"}}) + _, _ = writer.Write(data) + })) + defer server.Close() + client, _ := New(server.URL, "token", server.Client()) + response, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{}) + if err == nil || !strings.Contains(err.Error(), "HTTP 401: unauthorized") { + t.Fatalf("error = %v", err) + } + if response.GetHeader().GetCode() != 401 { + t.Fatalf("header = %#v", response.GetHeader()) + } + }) + + t.Run("malformed protobuf", func(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + _, _ = writer.Write([]byte{0xff}) + })) + defer server.Close() + client, _ := New(server.URL, "token", server.Client()) + if _, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{}); err == nil || !strings.Contains(err.Error(), "解析 Protobuf 响应失败") { + t.Fatalf("error = %v", err) + } + }) + + t.Run("response size limit", func(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + _, _ = writer.Write(make([]byte, maxResponseSize+1)) + })) + defer server.Close() + client, _ := New(server.URL, "token", server.Client()) + if _, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{}); err == nil || !strings.Contains(err.Error(), "16 MiB") { + t.Fatalf("error = %v", err) + } + }) +} + +func TestClientHonorsHTTPClientTimeout(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + time.Sleep(50 * time.Millisecond) + })) + defer server.Close() + httpClient := server.Client() + httpClient.Timeout = time.Millisecond + client, _ := New(server.URL, "token", httpClient) + _, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{}) + if err == nil || !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("error = %v", err) + } +} + +func TestClientRepresentativeOperationRoutes(t *testing.T) { + var paths []string + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + paths = append(paths, request.URL.Path) + var response proto.Message + switch request.URL.Path { + case apiPath + "/projects/create": + response = &api.ProjectResponse{Header: &api.ResponseHeader{Code: 200}} + case apiPath + "/quotations/delete/preview": + response = &api.DeletePreviewResponse{Header: &api.ResponseHeader{Code: 200}} + case apiPath + "/quotation/edit/command": + response = &api.QuotationEditCommandResponse{Header: &api.ResponseHeader{Code: 200}} + default: + t.Fatalf("unexpected path %q", request.URL.Path) + } + data, _ := proto.Marshal(response) + _, _ = writer.Write(data) + })) + defer server.Close() + client, _ := New(server.URL, "token", server.Client()) + if _, err := client.ProjectCreate(context.Background(), &api.ProjectCreateRequest{}); err != nil { + t.Fatal(err) + } + if _, err := client.QuotationDeletePreview(context.Background(), &api.QuotationDeletePreviewRequest{}); err != nil { + t.Fatal(err) + } + if _, err := client.EditCommand(context.Background(), &api.QuotationEditCommandRequest{}); err != nil { + t.Fatal(err) + } + want := []string{apiPath + "/projects/create", apiPath + "/quotations/delete/preview", apiPath + "/quotation/edit/command"} + if strings.Join(paths, "|") != strings.Join(want, "|") { + t.Fatalf("paths = %v", paths) + } +} + +func TestClientRejectsMissingConfigurationAndBusinessError(t *testing.T) { + if _, err := New("", "token", nil); err == nil { + t.Fatal("empty base URL accepted") + } + if _, err := New("https://example.com", "", nil); err == nil { + t.Fatal("empty token accepted") + } + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + data, _ := proto.Marshal(&api.CommonResponse{Header: &api.ResponseHeader{Code: 400, Message: "bad request", RequestId: "request-123", Replayed: true}}) + _, _ = writer.Write(data) + })) + defer server.Close() + client, _ := New(server.URL, "token", server.Client()) + response, err := client.ProjectGet(context.Background(), &api.ProjectGetRequest{}) + if err == nil { + t.Fatal("business error was accepted") + } + if response.GetHeader() == nil || !response.GetHeader().Replayed || response.GetHeader().RequestId != "request-123" { + t.Fatalf("business error response = %#v", response.GetHeader()) + } +} diff --git a/internal/command/commands.go b/internal/command/commands.go new file mode 100644 index 0000000..5c92ace --- /dev/null +++ b/internal/command/commands.go @@ -0,0 +1,455 @@ +package command + +import ( + "fmt" + "io" + "os" + "strings" + + dto "code.zhecent.com/open/shop-crm-agent/internal/api" + crmClient "code.zhecent.com/open/shop-crm-agent/internal/client" + + "github.com/spf13/cobra" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +type crmAgentWriteOptions struct{ requestID string } + +func New(version string) *cobra.Command { + cmd := &cobra.Command{ + Use: "shop-crm-agent", + Short: "通过 Protobuf API 操作 Shop CRM", + Version: version, + Args: cobra.NoArgs, + SilenceErrors: true, + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }, + } + cmd.AddCommand(newCrmAgentCustomerListCmd(), newCrmAgentProjectCmd(), newCrmAgentQuotationCmd(), newCrmAgentCatalogCmd(), newCrmAgentEditCmd()) + return cmd +} + +func newCrmAgentHTTPClient() (*crmClient.Client, error) { + return crmClient.New(os.Getenv("LIGHTCORE_API_BASE_URL"), os.Getenv("LIGHTCORE_SHOP_CRM_AGENT_TOKEN"), nil) +} + +func writeCrmAgentProto(writer io.Writer, message proto.Message) error { + data, err := (protojson.MarshalOptions{Indent: " ", EmitUnpopulated: true}).Marshal(message) + if err != nil { + return err + } + _, err = fmt.Fprintln(writer, string(data)) + return err +} + +type crmAgentHeaderResponse interface { + proto.Message + GetHeader() *dto.ResponseHeader +} + +func writeCrmAgentResult(writer io.Writer, response crmAgentHeaderResponse, commandErr error) error { + if response != nil && response.GetHeader() != nil { + if err := writeCrmAgentProto(writer, response); err != nil { + return err + } + } + return commandErr +} + +func printCrmAgentResult(response crmAgentHeaderResponse, commandErr error) error { + return writeCrmAgentResult(os.Stdout, response, commandErr) +} + +func bindCrmAgentWrite(cmd *cobra.Command, options *crmAgentWriteOptions) { + cmd.Flags().StringVar(&options.requestID, "request-id", "", "8-80位幂等请求 ID") + _ = cmd.MarkFlagRequired("request-id") +} + +func crmAgentCommandHeader(options crmAgentWriteOptions) *dto.CommandHeader { + return &dto.CommandHeader{RequestId: strings.TrimSpace(options.requestID)} +} + +func newCrmAgentCustomerListCmd() *cobra.Command { + var keyword string + var page, pageSize int32 + cmd := &cobra.Command{Use: "customer-list", Short: "查询创建项目可引用的 CRM 客户", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.CustomerList(cmd.Context(), &dto.CustomerListRequest{Keyword: keyword, Page: page, PageSize: pageSize}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().StringVar(&keyword, "keyword", "", "客户姓名或手机号") + cmd.Flags().Int32Var(&page, "page", 1, "页码") + cmd.Flags().Int32Var(&pageSize, "page-size", 20, "每页数量") + return cmd +} + +func newCrmAgentProjectCmd() *cobra.Command { + cmd := &cobra.Command{Use: "project", Short: "查询和维护 CRM 项目", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentProjectListCmd(), newCrmAgentProjectGetCmd(), newCrmAgentProjectCreateCmd(), newCrmAgentProjectUpdateCmd(), newCrmAgentProjectStatusCmd(), newCrmAgentProjectDeletePreviewCmd(), newCrmAgentProjectDeleteCmd()) + return cmd +} + +func newCrmAgentProjectListCmd() *cobra.Command { + var keyword, status, houseType string + var page, pageSize int32 + cmd := &cobra.Command{Use: "list", Short: "分页查询项目", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectList(cmd.Context(), &dto.ProjectListRequest{Keyword: keyword, Status: status, HouseType: houseType, Page: page, PageSize: pageSize}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().StringVar(&keyword, "keyword", "", "项目关键词") + cmd.Flags().StringVar(&status, "status", "", "项目状态") + cmd.Flags().StringVar(&houseType, "house-type", "", "房屋类型") + cmd.Flags().Int32Var(&page, "page", 1, "页码") + cmd.Flags().Int32Var(&pageSize, "page-size", 20, "每页数量") + return cmd +} + +func newCrmAgentProjectGetCmd() *cobra.Command { + var projectID uint64 + cmd := &cobra.Command{Use: "get", Short: "读取项目详情", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectGet(cmd.Context(), &dto.ProjectGetRequest{ProjectId: projectID}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + _ = cmd.MarkFlagRequired("project-id") + return cmd +} + +type crmAgentProjectFields struct { + name string + customerID uint64 + houseType, province, provinceCode, city, cityCode, district, districtCode, address, remark string +} + +func bindCrmAgentProjectFields(cmd *cobra.Command, fields *crmAgentProjectFields, includeCustomer, requireCore bool) { + cmd.Flags().StringVar(&fields.name, "name", "", "项目名称") + cmd.Flags().StringVar(&fields.houseType, "house-type", "", "房屋类型: flat/duplex/villa/commercial/other") + if includeCustomer { + cmd.Flags().Uint64Var(&fields.customerID, "customer-id", 0, "客户 ID") + _ = cmd.MarkFlagRequired("customer-id") + } + cmd.Flags().StringVar(&fields.province, "province", "", "省份") + cmd.Flags().StringVar(&fields.provinceCode, "province-code", "", "省份编码") + cmd.Flags().StringVar(&fields.city, "city", "", "城市") + cmd.Flags().StringVar(&fields.cityCode, "city-code", "", "城市编码") + cmd.Flags().StringVar(&fields.district, "district", "", "区县") + cmd.Flags().StringVar(&fields.districtCode, "district-code", "", "区县编码") + cmd.Flags().StringVar(&fields.address, "address", "", "详细地址") + cmd.Flags().StringVar(&fields.remark, "remark", "", "备注") + if requireCore { + _ = cmd.MarkFlagRequired("name") + _ = cmd.MarkFlagRequired("house-type") + } +} + +func newCrmAgentProjectCreateCmd() *cobra.Command { + var fields crmAgentProjectFields + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "create", Short: "创建项目", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectCreate(cmd.Context(), &dto.ProjectCreateRequest{Command: crmAgentCommandHeader(write), Name: fields.name, CustomerId: fields.customerID, HouseType: fields.houseType, Province: fields.province, ProvinceCode: fields.provinceCode, City: fields.city, CityCode: fields.cityCode, District: fields.district, DistrictCode: fields.districtCode, Address: fields.address, Remark: fields.remark}) + return printCrmAgentResult(response, err) + }} + bindCrmAgentProjectFields(cmd, &fields, true, true) + bindCrmAgentWrite(cmd, &write) + return cmd +} + +func newCrmAgentProjectUpdateCmd() *cobra.Command { + var projectID uint64 + var fields crmAgentProjectFields + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "update", Short: "更新项目资料", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectUpdate(cmd.Context(), &dto.ProjectUpdateRequest{ + Command: crmAgentCommandHeader(write), ProjectId: projectID, + Name: crmAgentChangedString(cmd, "name", fields.name), HouseType: crmAgentChangedString(cmd, "house-type", fields.houseType), + Province: crmAgentChangedString(cmd, "province", fields.province), ProvinceCode: crmAgentChangedString(cmd, "province-code", fields.provinceCode), + City: crmAgentChangedString(cmd, "city", fields.city), CityCode: crmAgentChangedString(cmd, "city-code", fields.cityCode), + District: crmAgentChangedString(cmd, "district", fields.district), DistrictCode: crmAgentChangedString(cmd, "district-code", fields.districtCode), + Address: crmAgentChangedString(cmd, "address", fields.address), + Remark: crmAgentChangedString(cmd, "remark", fields.remark), + }) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + _ = cmd.MarkFlagRequired("project-id") + bindCrmAgentProjectFields(cmd, &fields, false, false) + bindCrmAgentWrite(cmd, &write) + return cmd +} + +func crmAgentChangedString(cmd *cobra.Command, flagName, value string) *string { + if !cmd.Flags().Changed(flagName) { + return nil + } + return &value +} + +func newCrmAgentProjectStatusCmd() *cobra.Command { + var projectID uint64 + var status string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "status", Short: "修改项目状态", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectStatus(cmd.Context(), &dto.ProjectStatusRequest{Command: crmAgentCommandHeader(write), ProjectId: projectID, Status: status}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + cmd.Flags().StringVar(&status, "status", "", "状态: active/completed/shelved") + _ = cmd.MarkFlagRequired("project-id") + _ = cmd.MarkFlagRequired("status") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentProjectDeletePreviewCmd() *cobra.Command { + var projectID uint64 + cmd := &cobra.Command{Use: "delete-preview", Short: "预览空项目删除", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectDeletePreview(cmd.Context(), &dto.ProjectDeletePreviewRequest{ProjectId: projectID}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + _ = cmd.MarkFlagRequired("project-id") + return cmd +} +func newCrmAgentProjectDeleteCmd() *cobra.Command { + var projectID uint64 + var changeSet string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "delete", Short: "删除已预览的空项目", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.ProjectDelete(cmd.Context(), &dto.ProjectDeleteRequest{Command: crmAgentCommandHeader(write), ProjectId: projectID, ChangeSetId: changeSet}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + cmd.Flags().StringVar(&changeSet, "change-set-id", "", "delete-preview 返回的 changeSetId") + _ = cmd.MarkFlagRequired("project-id") + _ = cmd.MarkFlagRequired("change-set-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} + +func newCrmAgentQuotationCmd() *cobra.Command { + cmd := &cobra.Command{Use: "quotation", Short: "查询和维护独立报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentQuotationListCmd(), newCrmAgentQuotationGetCmd(), newCrmAgentQuotationCreateCmd(), newCrmAgentQuotationCopyCmd(), newCrmAgentQuotationTitleCmd(), newCrmAgentQuotationStatusCmd(), newCrmAgentQuotationLockCmd(true), newCrmAgentQuotationLockCmd(false), newCrmAgentQuotationDeletePreviewCmd(), newCrmAgentQuotationDeleteCmd()) + return cmd +} +func newCrmAgentQuotationListCmd() *cobra.Command { + var projectID uint64 + var keyword, status string + var page, pageSize int32 + cmd := &cobra.Command{Use: "list", Short: "分页查询报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationList(cmd.Context(), &dto.QuotationListRequest{ProjectId: projectID, Keyword: keyword, Status: status, Page: page, PageSize: pageSize}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + cmd.Flags().StringVar(&keyword, "keyword", "", "关键词") + cmd.Flags().StringVar(&status, "status", "", "报价状态") + cmd.Flags().Int32Var(&page, "page", 1, "页码") + cmd.Flags().Int32Var(&pageSize, "page-size", 20, "每页数量") + return cmd +} +func newCrmAgentQuotationGetCmd() *cobra.Command { + var id uint64 + cmd := &cobra.Command{Use: "get", Short: "读取报价详情", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationGet(cmd.Context(), &dto.QuotationGetRequest{QuotationId: id}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + _ = cmd.MarkFlagRequired("quotation-id") + return cmd +} +func newCrmAgentQuotationCreateCmd() *cobra.Command { + var projectID uint64 + var title string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "create", Short: "创建空报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationCreate(cmd.Context(), &dto.QuotationCreateRequest{Command: crmAgentCommandHeader(write), ProjectId: projectID, Title: title}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&projectID, "project-id", 0, "项目 ID") + cmd.Flags().StringVar(&title, "title", "报价", "报价标题") + _ = cmd.MarkFlagRequired("project-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentQuotationCopyCmd() *cobra.Command { + var id uint64 + var title string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "copy", Short: "复制独立报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationCopy(cmd.Context(), &dto.QuotationCopyRequest{Command: crmAgentCommandHeader(write), QuotationId: id, Title: title}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "源报价 ID") + cmd.Flags().StringVar(&title, "title", "", "副本标题") + _ = cmd.MarkFlagRequired("quotation-id") + _ = cmd.MarkFlagRequired("title") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentQuotationTitleCmd() *cobra.Command { + var id uint64 + var title string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "title", Short: "修改报价标题", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationTitle(cmd.Context(), &dto.QuotationTitleRequest{Command: crmAgentCommandHeader(write), QuotationId: id, Title: title}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + cmd.Flags().StringVar(&title, "title", "", "标题") + _ = cmd.MarkFlagRequired("quotation-id") + _ = cmd.MarkFlagRequired("title") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentQuotationStatusCmd() *cobra.Command { + var id uint64 + var status string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "status", Short: "修改报价状态", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationStatus(cmd.Context(), &dto.QuotationStatusRequest{Command: crmAgentCommandHeader(write), QuotationId: id, Status: status}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + cmd.Flags().StringVar(&status, "status", "", "报价状态") + _ = cmd.MarkFlagRequired("quotation-id") + _ = cmd.MarkFlagRequired("status") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentQuotationLockCmd(locked bool) *cobra.Command { + use, short := "unlock", "解锁报价" + if locked { + use, short = "lock", "锁定报价" + } + var id uint64 + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: use, Short: short, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + request := &dto.QuotationLockRequest{Command: crmAgentCommandHeader(write), QuotationId: id} + var response *dto.QuotationResponse + if locked { + response, err = client.QuotationLock(cmd.Context(), request) + } else { + response, err = client.QuotationUnlock(cmd.Context(), request) + } + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + _ = cmd.MarkFlagRequired("quotation-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentQuotationDeletePreviewCmd() *cobra.Command { + var id uint64 + cmd := &cobra.Command{Use: "delete-preview", Short: "预览报价删除", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationDeletePreview(cmd.Context(), &dto.QuotationDeletePreviewRequest{QuotationId: id}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + _ = cmd.MarkFlagRequired("quotation-id") + return cmd +} +func newCrmAgentQuotationDeleteCmd() *cobra.Command { + var id uint64 + var revision int32 + var changeSet string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "delete", Short: "按 revision 删除报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.QuotationDelete(cmd.Context(), &dto.QuotationDeleteRequest{Command: crmAgentCommandHeader(write), QuotationId: id, Revision: revision, ChangeSetId: changeSet}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var(&id, "quotation-id", 0, "报价 ID") + cmd.Flags().Int32Var(&revision, "revision", 0, "delete-preview 返回的 revision") + cmd.Flags().StringVar(&changeSet, "change-set-id", "", "delete-preview 返回的 changeSetId") + _ = cmd.MarkFlagRequired("quotation-id") + _ = cmd.MarkFlagRequired("revision") + _ = cmd.MarkFlagRequired("change-set-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} + +func newCrmAgentCatalogCmd() *cobra.Command { + var keyword string + var categoryID, rootCategoryID, brandID uint64 + var page, pageSize int32 + cmd := &cobra.Command{Use: "catalog-search", Short: "查询可加入报价的产品库 SKU", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.CatalogSearch(cmd.Context(), &dto.CatalogSearchRequest{Keyword: keyword, CategoryId: categoryID, RootCategoryId: rootCategoryID, BrandId: brandID, Page: page, PageSize: pageSize}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().StringVar(&keyword, "keyword", "", "关键词") + cmd.Flags().Uint64Var(&categoryID, "category-id", 0, "分类 ID") + cmd.Flags().Uint64Var(&rootCategoryID, "root-category-id", 0, "根分类 ID") + cmd.Flags().Uint64Var(&brandID, "brand-id", 0, "品牌 ID") + cmd.Flags().Int32Var(&page, "page", 1, "页码") + cmd.Flags().Int32Var(&pageSize, "page-size", 20, "每页数量") + return cmd +} diff --git a/internal/command/commands_test.go b/internal/command/commands_test.go new file mode 100644 index 0000000..cfaa0c6 --- /dev/null +++ b/internal/command/commands_test.go @@ -0,0 +1,94 @@ +package command + +import ( + "bytes" + "errors" + "testing" + + dto "code.zhecent.com/open/shop-crm-agent/internal/api" + + "google.golang.org/protobuf/encoding/protojson" +) + +func TestRootCommandExposesOnlyCrmOperations(t *testing.T) { + cmd := New("test-version") + want := map[string]bool{ + "customer-list": true, "project": true, + "quotation": true, "catalog-search": true, "edit": true, + } + for _, child := range cmd.Commands() { + if child.Name() == "credential" { + t.Fatal("external client exposes credential administration") + } + if child.Name() == "progress-template-list" { + t.Fatal("external client exposes retired progress template query") + } + delete(want, child.Name()) + } + if len(want) != 0 { + t.Fatalf("missing root commands = %v", want) + } + if cmd.Version != "test-version" { + t.Fatalf("version = %q", cmd.Version) + } +} + +func TestProjectCommandsExcludeProgressAndTemplateFlag(t *testing.T) { + root := New("test-version") + project, _, err := root.Find([]string{"project"}) + if err != nil { + t.Fatal(err) + } + for _, child := range project.Commands() { + if child.Name() == "progress-complete" { + t.Fatal("project command exposes retired progress completion") + } + } + for _, name := range []string{"create", "update"} { + command, _, findErr := root.Find([]string{"project", name}) + if findErr != nil { + t.Fatal(findErr) + } + if command.Flags().Lookup("progress-template-key") != nil { + t.Fatalf("project %s exposes retired progress template flag", name) + } + } +} + +func TestRemoteCommandRequiresEnvironmentConfiguration(t *testing.T) { + t.Setenv("LIGHTCORE_API_BASE_URL", "") + t.Setenv("LIGHTCORE_SHOP_CRM_AGENT_TOKEN", "") + cmd := New("test") + cmd.SetArgs([]string{"customer-list"}) + if err := cmd.Execute(); err == nil { + t.Fatal("missing environment configuration was accepted") + } +} + +func TestWriteCrmAgentResultPrintsStructuredBusinessError(t *testing.T) { + commandErr := errors.New("CRM Agent API 错误 400: 报价已锁定") + response := &dto.ProjectResponse{Header: &dto.ResponseHeader{ + Code: 400, Message: "报价已锁定", RequestId: "request-123", Replayed: true, + }} + var output bytes.Buffer + err := writeCrmAgentResult(&output, response, commandErr) + if !errors.Is(err, commandErr) { + t.Fatalf("command error = %v", err) + } + printed := &dto.ProjectResponse{} + if err := protojson.Unmarshal(output.Bytes(), printed); err != nil { + t.Fatalf("decode output: %v", err) + } + if printed.GetHeader() == nil || printed.GetHeader().Code != 400 || printed.GetHeader().RequestId != "request-123" || !printed.GetHeader().Replayed { + t.Fatalf("printed header = %#v", printed.GetHeader()) + } +} + +func TestWriteCrmAgentResultSkipsMissingTransportResponse(t *testing.T) { + commandErr := errors.New("connection refused") + var output bytes.Buffer + err := writeCrmAgentResult(&output, &dto.ProjectResponse{}, commandErr) + if !errors.Is(err, commandErr) || output.Len() != 0 { + t.Fatalf("error=%v output=%q", err, output.String()) + } +} diff --git a/internal/command/edit.go b/internal/command/edit.go new file mode 100644 index 0000000..781a51d --- /dev/null +++ b/internal/command/edit.go @@ -0,0 +1,568 @@ +package command + +import ( + "errors" + + dto "code.zhecent.com/open/shop-crm-agent/internal/api" + + "github.com/spf13/cobra" +) + +func newCrmAgentEditCmd() *cobra.Command { + cmd := &cobra.Command{Use: "edit", Short: "通过服务端会话编辑报价", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentEditBeginCmd(), newCrmAgentEditPreviewCmd(), newCrmAgentEditCommitCmd(), newCrmAgentEditDiscardCmd(), newCrmAgentEditFloorCmd(), newCrmAgentEditSpaceCmd(), newCrmAgentEditCategoryCmd(), newCrmAgentEditLineCmd(), newCrmAgentEditFeeCmd(), newCrmAgentEditPricingCmd()) + return cmd +} + +func newCrmAgentEditBeginCmd() *cobra.Command { + var quotationID uint64 + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "begin", Short: "开始报价编辑会话", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditBegin(cmd.Context(), &dto.QuotationEditBeginRequest{Command: crmAgentCommandHeader(write), QuotationId: quotationID}) + return printCrmAgentResult(response, err) + }} + cmd.Flags().Uint64Var("ationID, "quotation-id", 0, "报价 ID") + _ = cmd.MarkFlagRequired("quotation-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentEditPreviewCmd() *cobra.Command { + var sessionID string + cmd := &cobra.Command{Use: "preview", Short: "预览编辑并生成 changeSetId", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditPreview(cmd.Context(), &dto.QuotationEditPreviewRequest{SessionId: sessionID}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + return cmd +} +func newCrmAgentEditCommitCmd() *cobra.Command { + var sessionID, changeSet string + var revision int32 + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "commit", Short: "按 revision 和 changeSetId 提交编辑", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditCommit(cmd.Context(), &dto.QuotationEditCommitRequest{Command: crmAgentCommandHeader(write), SessionId: sessionID, Revision: revision, ChangeSetId: changeSet}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + cmd.Flags().Int32Var(&revision, "revision", 0, "preview 返回的 revision") + cmd.Flags().StringVar(&changeSet, "change-set-id", "", "preview 返回的 changeSetId") + _ = cmd.MarkFlagRequired("revision") + _ = cmd.MarkFlagRequired("change-set-id") + bindCrmAgentWrite(cmd, &write) + return cmd +} +func newCrmAgentEditDiscardCmd() *cobra.Command { + var sessionID string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "discard", Short: "丢弃编辑会话", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditDiscard(cmd.Context(), &dto.QuotationEditDiscardRequest{Command: crmAgentCommandHeader(write), SessionId: sessionID}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + bindCrmAgentWrite(cmd, &write) + return cmd +} + +func bindSessionID(cmd *cobra.Command, value *string) { + cmd.Flags().StringVar(value, "session-id", "", "报价编辑会话 ID") + _ = cmd.MarkFlagRequired("session-id") +} + +func newCrmAgentEditMutationCmd(use, short string, bind func(*cobra.Command), build func() *dto.QuotationEditCommandRequest) *cobra.Command { + var sessionID string + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: use, Short: short, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + request := build() + if request == nil { + return errors.New("编辑命令构造失败") + } + request.Command, request.SessionId = crmAgentCommandHeader(write), sessionID + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditCommand(cmd.Context(), request) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + bindCrmAgentWrite(cmd, &write) + if bind != nil { + bind(cmd) + } + return cmd +} + +func newCrmAgentEditFloorCmd() *cobra.Command { + cmd := &cobra.Command{Use: "floor", Short: "增改排序和移除楼层", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentFloorAddCmd(), newCrmAgentFloorRenameCmd(), newCrmAgentFloorReorderCmd(), newCrmAgentFloorRemoveCmd()) + return cmd +} +func newCrmAgentFloorAddCmd() *cobra.Command { + var id, name string + var index int32 = -1 + return newCrmAgentEditMutationCmd("add", "添加楼层", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "id", "", "可选稳定楼层 ID") + cmd.Flags().StringVar(&name, "name", "", "楼层名称") + cmd.Flags().Int32Var(&index, "index", -1, "插入索引,-1追加") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddFloor{AddFloor: &dto.AddFloor{Id: id, Name: name, Index: index}}} + }) +} +func newCrmAgentFloorRenameCmd() *cobra.Command { + var id, name string + return newCrmAgentEditMutationCmd("rename", "重命名楼层", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "floor-id", "", "楼层 ID") + cmd.Flags().StringVar(&name, "name", "", "新名称") + _ = cmd.MarkFlagRequired("floor-id") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RenameFloor{RenameFloor: &dto.RenameFloor{FloorId: id, Name: name}}} + }) +} +func newCrmAgentFloorReorderCmd() *cobra.Command { + var id string + var index int32 + return newCrmAgentEditMutationCmd("reorder", "调整楼层顺序", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "floor-id", "", "楼层 ID") + cmd.Flags().Int32Var(&index, "index", 0, "目标索引") + _ = cmd.MarkFlagRequired("floor-id") + _ = cmd.MarkFlagRequired("index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_ReorderFloor{ReorderFloor: &dto.ReorderFloor{FloorId: id, Index: index}}} + }) +} +func newCrmAgentFloorRemoveCmd() *cobra.Command { + var id string + var cascade bool + return newCrmAgentEditMutationCmd("remove", "移除楼层", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "floor-id", "", "楼层 ID") + cmd.Flags().BoolVar(&cascade, "cascade", false, "同时移除下属空间、分类和产品行") + _ = cmd.MarkFlagRequired("floor-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RemoveFloor{RemoveFloor: &dto.RemoveFloor{FloorId: id, Cascade: cascade}}} + }) +} + +func newCrmAgentEditSpaceCmd() *cobra.Command { + cmd := &cobra.Command{Use: "space", Short: "增改移动排序和移除空间", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentSpaceAddCmd(), newCrmAgentSpaceRenameCmd(), newCrmAgentSpaceMoveCmd(), newCrmAgentSpaceReorderCmd(), newCrmAgentSpaceRemoveCmd()) + return cmd +} +func newCrmAgentSpaceAddCmd() *cobra.Command { + var id, floorID, name string + var index int32 = -1 + return newCrmAgentEditMutationCmd("add", "添加空间", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "id", "", "可选稳定空间 ID") + cmd.Flags().StringVar(&floorID, "floor-id", "", "楼层 ID") + cmd.Flags().StringVar(&name, "name", "", "空间名称") + cmd.Flags().Int32Var(&index, "index", -1, "插入索引") + _ = cmd.MarkFlagRequired("floor-id") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddSpace{AddSpace: &dto.AddSpace{Id: id, FloorId: floorID, Name: name, Index: index}}} + }) +} +func newCrmAgentSpaceRenameCmd() *cobra.Command { + var id, name string + return newCrmAgentEditMutationCmd("rename", "重命名空间", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "space-id", "", "空间 ID") + cmd.Flags().StringVar(&name, "name", "", "新名称") + _ = cmd.MarkFlagRequired("space-id") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RenameSpace{RenameSpace: &dto.RenameSpace{SpaceId: id, Name: name}}} + }) +} +func newCrmAgentSpaceMoveCmd() *cobra.Command { + var id, floorID string + var index int32 = -1 + return newCrmAgentEditMutationCmd("move", "移动空间到其他楼层", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "space-id", "", "空间 ID") + cmd.Flags().StringVar(&floorID, "target-floor-id", "", "目标楼层 ID") + cmd.Flags().Int32Var(&index, "index", -1, "目标索引") + _ = cmd.MarkFlagRequired("space-id") + _ = cmd.MarkFlagRequired("target-floor-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_MoveSpace{MoveSpace: &dto.MoveSpace{SpaceId: id, TargetFloorId: floorID, Index: index}}} + }) +} +func newCrmAgentSpaceReorderCmd() *cobra.Command { + var id string + var index int32 + return newCrmAgentEditMutationCmd("reorder", "调整空间顺序", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "space-id", "", "空间 ID") + cmd.Flags().Int32Var(&index, "index", 0, "目标索引") + _ = cmd.MarkFlagRequired("space-id") + _ = cmd.MarkFlagRequired("index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_ReorderSpace{ReorderSpace: &dto.ReorderSpace{SpaceId: id, Index: index}}} + }) +} +func newCrmAgentSpaceRemoveCmd() *cobra.Command { + var id string + var cascade bool + return newCrmAgentEditMutationCmd("remove", "移除空间", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "space-id", "", "空间 ID") + cmd.Flags().BoolVar(&cascade, "cascade", false, "同时移除分类和产品行") + _ = cmd.MarkFlagRequired("space-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RemoveSpace{RemoveSpace: &dto.RemoveSpace{SpaceId: id, Cascade: cascade}}} + }) +} + +func newCrmAgentEditCategoryCmd() *cobra.Command { + cmd := &cobra.Command{Use: "category", Short: "增改排序和移除分类", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentCategoryAddCmd(), newCrmAgentCategoryRenameCmd(), newCrmAgentCategoryReorderCmd(), newCrmAgentCategoryRemoveCmd()) + return cmd +} +func newCrmAgentCategoryAddCmd() *cobra.Command { + var id, floorID, spaceID, name, source, sourceKey string + var index int32 = -1 + return newCrmAgentEditMutationCmd("add", "添加分类", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "id", "", "可选稳定分类 ID") + cmd.Flags().StringVar(&floorID, "floor-id", "", "楼层 ID") + cmd.Flags().StringVar(&spaceID, "space-id", "", "空间 ID") + cmd.Flags().StringVar(&name, "name", "", "分类名称") + cmd.Flags().StringVar(&source, "source", "custom", "来源") + cmd.Flags().StringVar(&sourceKey, "source-key", "", "来源 key") + cmd.Flags().Int32Var(&index, "index", -1, "插入索引") + _ = cmd.MarkFlagRequired("floor-id") + _ = cmd.MarkFlagRequired("space-id") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddCategory{AddCategory: &dto.AddCategory{Id: id, FloorId: floorID, SpaceId: spaceID, Name: name, Source: source, SourceKey: sourceKey, Index: index}}} + }) +} +func newCrmAgentCategoryRenameCmd() *cobra.Command { + var id, name string + return newCrmAgentEditMutationCmd("rename", "重命名分类", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "category-id", "", "分类 ID") + cmd.Flags().StringVar(&name, "name", "", "新名称") + _ = cmd.MarkFlagRequired("category-id") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RenameCategory{RenameCategory: &dto.RenameCategory{CategoryId: id, Name: name}}} + }) +} +func newCrmAgentCategoryReorderCmd() *cobra.Command { + var id string + var index int32 + return newCrmAgentEditMutationCmd("reorder", "调整分类顺序", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "category-id", "", "分类 ID") + cmd.Flags().Int32Var(&index, "index", 0, "目标索引") + _ = cmd.MarkFlagRequired("category-id") + _ = cmd.MarkFlagRequired("index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_ReorderCategory{ReorderCategory: &dto.ReorderCategory{CategoryId: id, Index: index}}} + }) +} +func newCrmAgentCategoryRemoveCmd() *cobra.Command { + var id string + var cascade bool + return newCrmAgentEditMutationCmd("remove", "移除分类", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&id, "category-id", "", "分类 ID") + cmd.Flags().BoolVar(&cascade, "cascade", false, "同时移除产品行") + _ = cmd.MarkFlagRequired("category-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RemoveCategory{RemoveCategory: &dto.RemoveCategory{CategoryId: id, Cascade: cascade}}} + }) +} + +func newCrmAgentEditLineCmd() *cobra.Command { + cmd := &cobra.Command{Use: "line", Short: "增改移动排序启停和移除产品行", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentLineAddCatalogCmd(), newCrmAgentLineAddCustomCmd(), newCrmAgentLineUpdateCmd(), newCrmAgentLineMoveCmd(), newCrmAgentLineReorderCmd(), newCrmAgentLineActiveCmd(true), newCrmAgentLineActiveCmd(false), newCrmAgentLineRemoveCmd()) + return cmd +} + +type crmAgentLineTarget struct { + floorID, spaceID, categoryID string + index int32 +} + +func bindLineTarget(cmd *cobra.Command, target *crmAgentLineTarget) { + cmd.Flags().StringVar(&target.floorID, "floor-id", "", "楼层 ID") + cmd.Flags().StringVar(&target.spaceID, "space-id", "", "空间 ID") + cmd.Flags().StringVar(&target.categoryID, "category-id", "", "分类 ID") + cmd.Flags().Int32Var(&target.index, "index", -1, "分类内索引,-1追加") + _ = cmd.MarkFlagRequired("floor-id") + _ = cmd.MarkFlagRequired("space-id") + _ = cmd.MarkFlagRequired("category-id") +} +func newCrmAgentLineAddCatalogCmd() *cobra.Command { + var target crmAgentLineTarget + var skuID uint64 + var quantity float64 = 1 + var discountRate int32 = 100 + var discountAmount int64 + var remark string + return newCrmAgentEditMutationCmd("add-catalog", "按 SKU 添加产品库行", func(cmd *cobra.Command) { + bindLineTarget(cmd, &target) + cmd.Flags().Uint64Var(&skuID, "sku-id", 0, "产品库 SKU ID") + cmd.Flags().Float64Var(&quantity, "quantity", 1, "数量") + cmd.Flags().Int32Var(&discountRate, "discount-rate", 100, "折扣率0-100") + cmd.Flags().Int64Var(&discountAmount, "discount-amount", 0, "优惠金额(分)") + cmd.Flags().StringVar(&remark, "remark", "", "备注") + _ = cmd.MarkFlagRequired("sku-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddCatalogLine{AddCatalogLine: &dto.AddCatalogLine{FloorId: target.floorID, SpaceId: target.spaceID, CategoryId: target.categoryID, SkuId: skuID, Quantity: quantity, DiscountRate: discountRate, DiscountAmount: discountAmount, Remark: remark, Index: target.index}}} + }) +} +func newCrmAgentLineAddCustomCmd() *cobra.Command { + var target crmAgentLineTarget + var name, spec, remark string + var quantity float64 = 1 + var unitPrice, costPrice, discountAmount int64 + var discountRate int32 = 100 + return newCrmAgentEditMutationCmd("add-custom", "添加自定义产品行", func(cmd *cobra.Command) { + bindLineTarget(cmd, &target) + cmd.Flags().StringVar(&name, "name", "", "产品名称") + cmd.Flags().StringVar(&spec, "spec", "", "规格") + cmd.Flags().Float64Var(&quantity, "quantity", 1, "数量") + cmd.Flags().Int64Var(&unitPrice, "unit-price", 0, "售价(分)") + cmd.Flags().Int64Var(&costPrice, "cost-price", 0, "成本(分)") + cmd.Flags().Int32Var(&discountRate, "discount-rate", 100, "折扣率0-100") + cmd.Flags().Int64Var(&discountAmount, "discount-amount", 0, "优惠金额(分)") + cmd.Flags().StringVar(&remark, "remark", "", "备注") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddCustomLine{AddCustomLine: &dto.AddCustomLine{FloorId: target.floorID, SpaceId: target.spaceID, CategoryId: target.categoryID, GoodsName: name, SpecCombination: spec, Quantity: quantity, UnitPrice: unitPrice, CostPrice: costPrice, DiscountRate: discountRate, DiscountAmount: discountAmount, Remark: remark, Index: target.index}}} + }) +} +func newCrmAgentLineUpdateCmd() *cobra.Command { + var sessionID, lineID, name, spec, remark string + var quantity float64 + var unitPrice, costPrice, discountAmount int64 + var discountRate int32 + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "update", Short: "按已提供 flags 更新产品行", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + update := &dto.UpdateLine{LineId: lineID} + if cmd.Flags().Changed("name") { + update.GoodsName = &name + } + if cmd.Flags().Changed("spec") { + update.SpecCombination = &spec + } + if cmd.Flags().Changed("quantity") { + update.Quantity = &quantity + } + if cmd.Flags().Changed("unit-price") { + update.UnitPrice = &unitPrice + } + if cmd.Flags().Changed("cost-price") { + update.CostPrice = &costPrice + } + if cmd.Flags().Changed("discount-rate") { + update.DiscountRate = &discountRate + } + if cmd.Flags().Changed("discount-amount") { + update.DiscountAmount = &discountAmount + } + if cmd.Flags().Changed("remark") { + update.Remark = &remark + } + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditCommand(cmd.Context(), &dto.QuotationEditCommandRequest{Command: crmAgentCommandHeader(write), SessionId: sessionID, Edit: &dto.QuotationEditCommandRequest_UpdateLine{UpdateLine: update}}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + bindCrmAgentWrite(cmd, &write) + cmd.Flags().StringVar(&lineID, "line-id", "", "产品行 ID") + cmd.Flags().StringVar(&name, "name", "", "产品名称(仅自定义行)") + cmd.Flags().StringVar(&spec, "spec", "", "规格(仅自定义行)") + cmd.Flags().Float64Var(&quantity, "quantity", 0, "数量") + cmd.Flags().Int64Var(&unitPrice, "unit-price", 0, "售价(分)") + cmd.Flags().Int64Var(&costPrice, "cost-price", 0, "成本(分,仅自定义行)") + cmd.Flags().Int32Var(&discountRate, "discount-rate", 0, "折扣率0-100") + cmd.Flags().Int64Var(&discountAmount, "discount-amount", 0, "优惠金额(分)") + cmd.Flags().StringVar(&remark, "remark", "", "备注") + _ = cmd.MarkFlagRequired("line-id") + return cmd +} +func newCrmAgentLineMoveCmd() *cobra.Command { + var target crmAgentLineTarget + var lineID string + return newCrmAgentEditMutationCmd("move", "移动产品行", func(cmd *cobra.Command) { + bindLineTarget(cmd, &target) + cmd.Flags().StringVar(&lineID, "line-id", "", "产品行 ID") + _ = cmd.MarkFlagRequired("line-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_MoveLine{MoveLine: &dto.MoveLine{LineId: lineID, FloorId: target.floorID, SpaceId: target.spaceID, CategoryId: target.categoryID, Index: target.index}}} + }) +} +func newCrmAgentLineReorderCmd() *cobra.Command { + var lineID string + var index int32 + return newCrmAgentEditMutationCmd("reorder", "调整产品行在分类内的顺序", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&lineID, "line-id", "", "产品行 ID") + cmd.Flags().Int32Var(&index, "index", 0, "目标索引") + _ = cmd.MarkFlagRequired("line-id") + _ = cmd.MarkFlagRequired("index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_ReorderLine{ReorderLine: &dto.ReorderLine{LineId: lineID, Index: index}}} + }) +} +func newCrmAgentLineActiveCmd(active bool) *cobra.Command { + use, short := "disable", "停用产品行" + if active { + use, short = "enable", "启用产品行" + } + var lineID string + return newCrmAgentEditMutationCmd(use, short, func(cmd *cobra.Command) { + cmd.Flags().StringVar(&lineID, "line-id", "", "产品行 ID") + _ = cmd.MarkFlagRequired("line-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_SetLineActive{SetLineActive: &dto.SetLineActive{LineId: lineID, Active: active}}} + }) +} +func newCrmAgentLineRemoveCmd() *cobra.Command { + var lineID string + return newCrmAgentEditMutationCmd("remove", "移除产品行", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&lineID, "line-id", "", "产品行 ID") + _ = cmd.MarkFlagRequired("line-id") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RemoveLine{RemoveLine: &dto.RemoveLine{LineId: lineID}}} + }) +} + +func newCrmAgentEditFeeCmd() *cobra.Command { + cmd := &cobra.Command{Use: "fee", Short: "增改排序和移除费用", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }} + cmd.AddCommand(newCrmAgentFeeAddCmd(), newCrmAgentFeeUpdateCmd(), newCrmAgentFeeReorderCmd(), newCrmAgentFeeRemoveCmd()) + return cmd +} +func newCrmAgentFeeAddCmd() *cobra.Command { + var name, feeType, remark string + var fixedAmount int64 + var percentage, index int32 + index = -1 + return newCrmAgentEditMutationCmd("add", "添加费用", func(cmd *cobra.Command) { + cmd.Flags().StringVar(&name, "name", "", "费用名称") + cmd.Flags().StringVar(&feeType, "type", "fixed", "fixed/discounted_percent/original_percent") + cmd.Flags().Int64Var(&fixedAmount, "fixed-amount", 0, "固定金额(分)") + cmd.Flags().Int32Var(&percentage, "percentage", 0, "百分比0-100") + cmd.Flags().Int32Var(&index, "index", -1, "插入索引") + cmd.Flags().StringVar(&remark, "remark", "", "备注") + _ = cmd.MarkFlagRequired("name") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_AddFee{AddFee: &dto.AddFee{Name: name, Type: feeType, FixedAmount: fixedAmount, Percentage: percentage, Index: index, Remark: remark}}} + }) +} +func newCrmAgentFeeUpdateCmd() *cobra.Command { + var sessionID, name, feeType, remark string + var index, percentage int32 + var fixedAmount int64 + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "update", Short: "按已提供 flags 更新费用", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + update := &dto.UpdateFee{Index: index} + if cmd.Flags().Changed("name") { + update.Name = &name + } + if cmd.Flags().Changed("type") { + update.Type = &feeType + } + if cmd.Flags().Changed("fixed-amount") { + update.FixedAmount = &fixedAmount + } + if cmd.Flags().Changed("percentage") { + update.Percentage = &percentage + } + if cmd.Flags().Changed("remark") { + update.Remark = &remark + } + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditCommand(cmd.Context(), &dto.QuotationEditCommandRequest{Command: crmAgentCommandHeader(write), SessionId: sessionID, Edit: &dto.QuotationEditCommandRequest_UpdateFee{UpdateFee: update}}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + bindCrmAgentWrite(cmd, &write) + cmd.Flags().Int32Var(&index, "index", -1, "费用索引") + cmd.Flags().StringVar(&name, "name", "", "名称") + cmd.Flags().StringVar(&feeType, "type", "", "费用类型") + cmd.Flags().Int64Var(&fixedAmount, "fixed-amount", 0, "固定金额(分)") + cmd.Flags().Int32Var(&percentage, "percentage", 0, "百分比0-100") + cmd.Flags().StringVar(&remark, "remark", "", "备注") + _ = cmd.MarkFlagRequired("index") + return cmd +} +func newCrmAgentFeeReorderCmd() *cobra.Command { + var index, target int32 + return newCrmAgentEditMutationCmd("reorder", "调整费用顺序", func(cmd *cobra.Command) { + cmd.Flags().Int32Var(&index, "index", -1, "当前索引") + cmd.Flags().Int32Var(&target, "target-index", 0, "目标索引") + _ = cmd.MarkFlagRequired("index") + _ = cmd.MarkFlagRequired("target-index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_ReorderFee{ReorderFee: &dto.ReorderFee{Index: index, TargetIndex: target}}} + }) +} +func newCrmAgentFeeRemoveCmd() *cobra.Command { + var index int32 + return newCrmAgentEditMutationCmd("remove", "移除费用", func(cmd *cobra.Command) { + cmd.Flags().Int32Var(&index, "index", -1, "费用索引") + _ = cmd.MarkFlagRequired("index") + }, func() *dto.QuotationEditCommandRequest { + return &dto.QuotationEditCommandRequest{Edit: &dto.QuotationEditCommandRequest_RemoveFee{RemoveFee: &dto.RemoveFee{Index: index}}} + }) +} + +func newCrmAgentEditPricingCmd() *cobra.Command { + var sessionID, remark string + var discountRate int32 + var discountAmount, actualAmount int64 + var adjusted bool + var write crmAgentWriteOptions + cmd := &cobra.Command{Use: "pricing", Short: "修改整单折扣、优惠、实际金额或调价标记", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { + pricing := &dto.SetPricing{} + if cmd.Flags().Changed("discount-rate") { + pricing.DiscountRate = &discountRate + } + if cmd.Flags().Changed("discount-amount") { + pricing.DiscountAmount = &discountAmount + } + if cmd.Flags().Changed("actual-amount") { + pricing.ActualAmount = &actualAmount + } + if cmd.Flags().Changed("adjusted") { + pricing.HasPriceAdjustment = &adjusted + } + if cmd.Flags().Changed("remark") { + pricing.Remark = &remark + } + client, err := newCrmAgentHTTPClient() + if err != nil { + return err + } + response, err := client.EditCommand(cmd.Context(), &dto.QuotationEditCommandRequest{Command: crmAgentCommandHeader(write), SessionId: sessionID, Edit: &dto.QuotationEditCommandRequest_SetPricing{SetPricing: pricing}}) + return printCrmAgentResult(response, err) + }} + bindSessionID(cmd, &sessionID) + bindCrmAgentWrite(cmd, &write) + cmd.Flags().Int32Var(&discountRate, "discount-rate", 0, "整单折扣率0-100") + cmd.Flags().Int64Var(&discountAmount, "discount-amount", 0, "整单优惠金额(分)") + cmd.Flags().Int64Var(&actualAmount, "actual-amount", 0, "实际成交金额(分)") + cmd.Flags().BoolVar(&adjusted, "adjusted", false, "是否标记人工调价") + cmd.Flags().StringVar(&remark, "remark", "", "报价备注") + return cmd +} diff --git a/scripts/build.go b/scripts/build.go new file mode 100644 index 0000000..b63cc5a --- /dev/null +++ b/scripts/build.go @@ -0,0 +1,129 @@ +//go:build ignore + +package main + +import ( + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" +) + +const modulePath = "code.zhecent.com/open/shop-crm-agent" + +func main() { + if err := run(); err != nil { + _, _ = fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func run() error { + repoRoot, err := os.Getwd() + if err != nil { + return err + } + if _, err := os.Stat(filepath.Join(repoRoot, "go.mod")); err != nil { + return errors.New("build.go must run from the shop-crm-agent repository root") + } + moduleCommand := exec.Command("go", "list", "-m", "-f", "{{.Path}}") + moduleCommand.Dir = repoRoot + moduleOutput, err := moduleCommand.CombinedOutput() + if err != nil { + return fmt.Errorf("read Go module path: %w: %s", err, strings.TrimSpace(string(moduleOutput))) + } + if actualModule := strings.TrimSpace(string(moduleOutput)); actualModule != modulePath { + return fmt.Errorf("unexpected Go module; want %s", modulePath) + } + + env := withEnv(os.Environ(), "CGO_ENABLED", "0") + if err := runCommand(repoRoot, env, "go", "test", "./..."); err != nil { + return fmt.Errorf("test shop-crm-agent: %w", err) + } + + version := gitVersion(repoRoot) + binaryName := "shop-crm-agent" + if runtime.GOOS == "windows" { + binaryName += ".exe" + } + binDir := filepath.Join(repoRoot, "bin") + if err := os.MkdirAll(binDir, 0o755); err != nil { + return err + } + tempFile, err := os.CreateTemp(binDir, "."+binaryName+".tmp-") + if err != nil { + return err + } + tempPath := tempFile.Name() + if err := tempFile.Close(); err != nil { + return err + } + if err := os.Remove(tempPath); err != nil { + return err + } + defer os.Remove(tempPath) + + ldflags := "-s -w -X main.version=" + version + if err := runCommand(repoRoot, env, "go", "build", "-trimpath", "-ldflags", ldflags, "-o", tempPath, "./cmd/shop-crm-agent"); err != nil { + return fmt.Errorf("build shop-crm-agent: %w", err) + } + if runtime.GOOS != "windows" { + if err := os.Chmod(tempPath, 0o755); err != nil { + return err + } + } + probe := exec.Command(tempPath, "--version") + probe.Dir = repoRoot + probeOutput, err := probe.CombinedOutput() + if err != nil { + return fmt.Errorf("probe built binary: %w: %s", err, strings.TrimSpace(string(probeOutput))) + } + + targetPath := filepath.Join(binDir, binaryName) + if err := replaceBinary(tempPath, targetPath); err != nil { + return err + } + fmt.Printf("installed: %s\n", filepath.Join("bin", binaryName)) + fmt.Printf("version: %s\n", strings.TrimSpace(string(probeOutput))) + return nil +} + +func gitVersion(repoRoot string) string { + command := exec.Command("git", "describe", "--tags", "--always", "--dirty") + command.Dir = repoRoot + output, err := command.Output() + if err != nil || strings.TrimSpace(string(output)) == "" { + return "dev" + } + return strings.TrimSpace(string(output)) +} + +func replaceBinary(source, target string) error { + if err := os.Rename(source, target); err != nil { + return fmt.Errorf("install built binary: %w", err) + } + return nil +} + +func runCommand(dir string, env []string, name string, args ...string) error { + command := exec.Command(name, args...) + command.Dir = dir + command.Env = env + command.Stdout = os.Stdout + command.Stderr = os.Stderr + return command.Run() +} + +func withEnv(env []string, key, value string) []string { + prefix := key + "=" + result := make([]string, 0, len(env)+1) + for _, entry := range env { + if !strings.HasPrefix(entry, prefix) { + result = append(result, entry) + } + } + return append(result, prefix+value) +}