package de.avatic.taricdb.model;

import java.util.HashSet;
import java.util.Set;

import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection;

import jakarta.validation.constraints.Size;


public class MonetaryUnit {

	@Id
    private Integer id;

    @Size(max = 3)
    private String monetaryUnitCode;

    @MappedCollection(idColumn = "ref_id")
	private Set<MonetaryUnitDesc> monetaryUnitDesc;

    public MonetaryUnit(String monetaryUnitCode) {
		this.monetaryUnitCode = monetaryUnitCode;
		this.monetaryUnitDesc = new HashSet<>();
	}

	public Integer getId() {
        return id;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public String getMonetaryUnitCode() {
        return monetaryUnitCode;
    }

    public void setMonetaryUnitCode(final String monetaryUnitCode) {
        this.monetaryUnitCode = monetaryUnitCode;
    }
    
	public void addMonetaryUnitDesc(MonetaryUnitDesc monetaryUnitDesc) {
    	this.monetaryUnitDesc.add(monetaryUnitDesc);
    }

}
