feat(ADM-018): completed feature

This commit is contained in:
chattie
2026-08-17 22:23:10 +02:00
parent cf1c69fc8b
commit d595b4871f
871 changed files with 47411 additions and 281 deletions

View File

@@ -0,0 +1,18 @@
import type { NewPromotion, Promotion, PromotionDiscount } from './promotion.js';
export interface PromotionService {
create(input: NewPromotion): Promise<Promotion>;
calculateDiscount(code: string, cartTotalCents: number, now?: Date): Promise<PromotionDiscount>;
validateCode(code: string, now?: Date): Promise<Promotion>;
list(): Promise<Promotion[]>;
update(code: string, patch: Partial<NewPromotion>): Promise<Promotion>;
delete(code: string): Promise<void>;
}
export interface PromotionRepository {
findByCode(code: string): Promise<Promotion | undefined>;
create(input: NewPromotion): Promise<Promotion>;
findAll(): Promise<Promotion[]>;
update(code: string, patch: Partial<NewPromotion>): Promise<Promotion>;
delete(code: string): Promise<void>;
}