MCPcopy Create free account
hub / github.com/Creatly/creatly-backend / Create

Method Create

internal/service/promocodes.go:20–28  ·  view source on GitHub ↗
(ctx context.Context, inp CreatePromoCodeInput)

Source from the content-addressed store, hash-verified

18}
19
20func (s *PromoCodeService) Create(ctx context.Context, inp CreatePromoCodeInput) (primitive.ObjectID, error) {
21 return s.repo.Create(ctx, domain.PromoCode{
22 SchoolID: inp.SchoolID,
23 Code: inp.Code,
24 DiscountPercentage: inp.DiscountPercentage,
25 ExpiresAt: inp.ExpiresAt,
26 OfferIDs: inp.OfferIDs,
27 })
28}
29
30func (s *PromoCodeService) Update(ctx context.Context, inp domain.UpdatePromoCodeInput) error {
31 return s.repo.Update(ctx, inp)

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected