20 lines
374 B
Go
20 lines
374 B
Go
|
|
package subscribeplanrepository
|
||
|
|
|
||
|
|
import (
|
||
|
|
subscribeplandomain "github.com/ardeman/project-legalgo-go/internal/domain/subscribe_plan"
|
||
|
|
"github.com/google/uuid"
|
||
|
|
)
|
||
|
|
|
||
|
|
func (s *SubsPlan) Create(code string) error {
|
||
|
|
spec := &subscribeplandomain.SubscribePlan{
|
||
|
|
ID: uuid.New(),
|
||
|
|
Code: code,
|
||
|
|
}
|
||
|
|
|
||
|
|
if err := s.DB.Create(&spec).Error; err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|