feat: 添加争议微服务,支持订单争议流程

This commit is contained in:
zetaloop
2026-04-24 12:31:41 +08:00
parent 6edf15996c
commit 95f2f10f9f
66 changed files with 13301 additions and 57 deletions
@@ -0,0 +1,186 @@
// Code generated by ent, DO NOT EDIT.
package disputes
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the disputes type in the database.
Label = "disputes"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldOrderID holds the string denoting the order_id field in the database.
FieldOrderID = "order_id"
// FieldInitiatorID holds the string denoting the initiator_id field in the database.
FieldInitiatorID = "initiator_id"
// FieldInitiatorName holds the string denoting the initiator_name field in the database.
FieldInitiatorName = "initiator_name"
// FieldRespondentID holds the string denoting the respondent_id field in the database.
FieldRespondentID = "respondent_id"
// FieldReason holds the string denoting the reason field in the database.
FieldReason = "reason"
// FieldEvidence holds the string denoting the evidence field in the database.
FieldEvidence = "evidence"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldResult holds the string denoting the result field in the database.
FieldResult = "result"
// FieldRespondentReason holds the string denoting the respondent_reason field in the database.
FieldRespondentReason = "respondent_reason"
// FieldRespondentEvidence holds the string denoting the respondent_evidence field in the database.
FieldRespondentEvidence = "respondent_evidence"
// FieldAppealReason holds the string denoting the appeal_reason field in the database.
FieldAppealReason = "appeal_reason"
// FieldAppealedAt holds the string denoting the appealed_at field in the database.
FieldAppealedAt = "appealed_at"
// FieldResolvedBy holds the string denoting the resolved_by field in the database.
FieldResolvedBy = "resolved_by"
// FieldResolvedAt holds the string denoting the resolved_at field in the database.
FieldResolvedAt = "resolved_at"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the disputes in the database.
Table = "disputes"
)
// Columns holds all SQL columns for disputes fields.
var Columns = []string{
FieldID,
FieldOrderID,
FieldInitiatorID,
FieldInitiatorName,
FieldRespondentID,
FieldReason,
FieldEvidence,
FieldStatus,
FieldResult,
FieldRespondentReason,
FieldRespondentEvidence,
FieldAppealReason,
FieldAppealedAt,
FieldResolvedBy,
FieldResolvedAt,
FieldCreatedAt,
FieldUpdatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// InitiatorNameValidator is a validator for the "initiator_name" field. It is called by the builders before save.
InitiatorNameValidator func(string) error
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
StatusValidator func(string) error
// ResultValidator is a validator for the "result" field. It is called by the builders before save.
ResultValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
)
// OrderOption defines the ordering options for the Disputes queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByOrderID orders the results by the order_id field.
func ByOrderID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderID, opts...).ToFunc()
}
// ByInitiatorID orders the results by the initiator_id field.
func ByInitiatorID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInitiatorID, opts...).ToFunc()
}
// ByInitiatorName orders the results by the initiator_name field.
func ByInitiatorName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInitiatorName, opts...).ToFunc()
}
// ByRespondentID orders the results by the respondent_id field.
func ByRespondentID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRespondentID, opts...).ToFunc()
}
// ByReason orders the results by the reason field.
func ByReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReason, opts...).ToFunc()
}
// ByEvidence orders the results by the evidence field.
func ByEvidence(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEvidence, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByResult orders the results by the result field.
func ByResult(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResult, opts...).ToFunc()
}
// ByRespondentReason orders the results by the respondent_reason field.
func ByRespondentReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRespondentReason, opts...).ToFunc()
}
// ByRespondentEvidence orders the results by the respondent_evidence field.
func ByRespondentEvidence(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRespondentEvidence, opts...).ToFunc()
}
// ByAppealReason orders the results by the appeal_reason field.
func ByAppealReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAppealReason, opts...).ToFunc()
}
// ByAppealedAt orders the results by the appealed_at field.
func ByAppealedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAppealedAt, opts...).ToFunc()
}
// ByResolvedBy orders the results by the resolved_by field.
func ByResolvedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResolvedBy, opts...).ToFunc()
}
// ByResolvedAt orders the results by the resolved_at field.
func ByResolvedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResolvedAt, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
File diff suppressed because it is too large Load Diff