package com.bcxin.tenant.open.domains.services.commands;

import com.bcxin.tenant.open.infrastructures.commands.CommandAbstract;
import com.bcxin.tenant.open.infrastructures.enums.UserPurseTransactionType;
import lombok.Getter;

import java.util.Collection;

@Getter
public class CreateUserPurseTransactionCommand extends CommandAbstract {
    private final UserPurseTransactionType referenceType;
    private final String referenceNumber;
    private final String tenantUserId;
    private final String note;
    private final long points;

    public CreateUserPurseTransactionCommand(UserPurseTransactionType referenceType, String referenceNumber, String tenantUserId, String note, long points) {
        this.referenceType = referenceType;
        this.referenceNumber = referenceNumber;
        this.tenantUserId = tenantUserId;
        this.note = note;
        this.points = points;
    }

    public static CreateUserPurseTransactionCommand create(UserPurseTransactionType referenceType, String referenceNumber, String tenantUserId, String note, long points) {
        return new CreateUserPurseTransactionCommand(referenceType, referenceNumber, tenantUserId, note, points);
    }

    @Getter
    public static class CreateUserPurseTransactionsCommand extends CommandAbstract
    {
        private final Collection<CreateUserPurseTransactionCommand> transactions;

        public CreateUserPurseTransactionsCommand(Collection<CreateUserPurseTransactionCommand> transactions) {
            this.transactions = transactions;
        }

        public static CreateUserPurseTransactionsCommand create(Collection<CreateUserPurseTransactionCommand> transactions) {
            return new CreateUserPurseTransactionsCommand(
                    transactions
            );
        }
    }
}
