feat: tenant-scoped routing and portal navigation
This commit is contained in:
@@ -39,6 +39,7 @@ func Test_Coupon(t *testing.T) {
|
||||
func (s *CouponTestSuite) Test_CouponFlow() {
|
||||
Convey("Coupon Flow", s.T(), func() {
|
||||
ctx := s.T().Context()
|
||||
tenantID := int64(1)
|
||||
database.Truncate(
|
||||
ctx,
|
||||
s.DB,
|
||||
@@ -83,9 +84,10 @@ func (s *CouponTestSuite) Test_CouponFlow() {
|
||||
|
||||
Convey("should apply in Order.Create", func() {
|
||||
// Setup Content
|
||||
c := &models.Content{UserID: 99, Title: "Test", Status: consts.ContentStatusPublished}
|
||||
c := &models.Content{TenantID: tenantID, UserID: 99, Title: "Test", Status: consts.ContentStatusPublished}
|
||||
models.ContentQuery.WithContext(ctx).Create(c)
|
||||
models.ContentPriceQuery.WithContext(ctx).Create(&models.ContentPrice{
|
||||
TenantID: tenantID,
|
||||
ContentID: c.ID,
|
||||
PriceAmount: 2000, // 20.00 CNY
|
||||
Currency: "CNY",
|
||||
@@ -96,7 +98,7 @@ func (s *CouponTestSuite) Test_CouponFlow() {
|
||||
UserCouponID: uc.ID,
|
||||
}
|
||||
// Simulate Auth context for Order service
|
||||
res, err := Order.Create(ctx, user.ID, form)
|
||||
res, err := Order.Create(ctx, tenantID, user.ID, form)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
// Verify Order
|
||||
|
||||
Reference in New Issue
Block a user