Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription struct is not up to date with casdoor #137

Closed
xiemax100 opened this issue Oct 12, 2024 · 1 comment · Fixed by #136
Closed

Subscription struct is not up to date with casdoor #137

xiemax100 opened this issue Oct 12, 2024 · 1 comment · Fixed by #136
Assignees
Labels
enhancement New feature or request

Comments

@xiemax100
Copy link
Contributor

current go sdk Subscription struct def:

// Subscription has the same definition as https://github.com/casdoor/casdoor/blob/master/object/subscription.go#L24
type Subscription struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`

	StartDate   time.Time `json:"startDate"`
	EndDate     time.Time `json:"endDate"`
	Duration    int       `json:"duration"`
	Description string    `xorm:"varchar(100)" json:"description"`

	User string `xorm:"mediumtext" json:"user"`
	Plan string `xorm:"varchar(100)" json:"plan"`

	IsEnabled   bool   `json:"isEnabled"`
	Submitter   string `xorm:"varchar(100)" json:"submitter"`
	Approver    string `xorm:"varchar(100)" json:"approver"`
	ApproveTime string `xorm:"varchar(100)" json:"approveTime"`

	State string `xorm:"varchar(100)" json:"state"`
}

while Casdoor has newer def:

type SubscriptionState string

const (
	SubStatePending   SubscriptionState = "Pending"
	SubStateError     SubscriptionState = "Error"
	SubStateSuspended SubscriptionState = "Suspended" // suspended by the admin

	SubStateActive   SubscriptionState = "Active"
	SubStateUpcoming SubscriptionState = "Upcoming"
	SubStateExpired  SubscriptionState = "Expired"
)

type Subscription struct {
	Owner       string `xorm:"varchar(100) notnull pk" json:"owner"`
	Name        string `xorm:"varchar(100) notnull pk" json:"name"`
	DisplayName string `xorm:"varchar(100)" json:"displayName"`
	CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
	Description string `xorm:"varchar(100)" json:"description"`

	User    string `xorm:"varchar(100)" json:"user"`
	Pricing string `xorm:"varchar(100)" json:"pricing"`
	Plan    string `xorm:"varchar(100)" json:"plan"`
	Payment string `xorm:"varchar(100)" json:"payment"`

	StartTime time.Time         `json:"startTime"`
	EndTime   time.Time         `json:"endTime"`
	Period    string            `xorm:"varchar(100)" json:"period"`
	State     SubscriptionState `xorm:"varchar(100)" json:"state"`
}
@casbin-bot
Copy link

@casbin-bot casbin-bot added the question Further information is requested label Oct 12, 2024
@hsluoyz hsluoyz added enhancement New feature or request and removed question Further information is requested labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants