ETL design over an existing DDD aggregate

I hope you can help me with the design of a data ingestion process.

Currently, I have an existing aggregate called ExperiencePricing and an existing command called SetExperiencePricingCommand. The aggregate represents the price of a tour over a list of periods.

A business request has asked me to support the upload of a CSV file to simultaneously set the prices of different tours.

The immediate idea is to process the M rows of the file and generate N (N < M) SetExperiencePricingCommands to be launched one by one in a fire-and-forget manner.

One of the main requirements is to provide feedback to the user. If there are errors, they should be displayed, and the operation should continue until the entire file is validated. The user will need to fix any errors and create another request. Obviously, the result (partial or final of the process) must be saved so that it can be viewed in the future as well.

Each Record has 3 pieces of information – Value Objects (TargetTour, TargetPrice, TargetPeriod), and
the flow that could lead me to the construction of the command is as follows:

File –> Parsing –> Merging –> Processing –> Validation

Parsing create Value Objects and basic invariants

(e.g., type compliance, price > 0, startDate < endDate)

Merging collapse records

I can generate an entity ensuring the following invariant:

if (A.TargetTour == B.TargetTour && A.TargetPrice == B.TargetPrice && A.TargetPeriod.Overlaps(B.TargetPeriod))
then new C(A.TargetProduct, A.TargetPrice, Merge(A.TargetPeriod, B.TargetPeriod))

Processing: Business rule application

  • Business rule application

    if (A.TargetTour == B.TargetTour && 
      A.TargetPrice != B.TargetPrice && 
      A.TargetPeriod.Overlaps(B.TargetPeriod)
      )
      then the price to apply during the overlapping period is that of
      A if A.TargetPeriod.Days < B.TargetPeriod.Days
      B if A.TargetPeriod.Days > B.TargetPeriod.Days
      C Fail
    

The output will be an Entity of type (TargetTour, TargetPrice, List)

  • Hidrate (fetch default values from Tour configuration and so on)

Validation:

TourExistencePolicy: Tour exists on database

TargetPeriodsPolicy each period in List is inside a List of RunningPeriods defined for the Tour

After validation, a summary is provided to the user, and the set of commands should only be launched after confirmation.

My difficulty lies in modeling this process in DDD since there are different invariants at different stages. Some invariants apply to the individual record, some to a grouping of records, and others to a different grouping.

Does it make sense to create an aggregate for each phase of the process?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật