import { Entity, model, property } from '@loopback/repository';

/**
 * Contains the information about how many invoices have been created in a specific year.
 */
@model()
export class NumberInvoices extends Entity {
    /**
     * The unique uuid.
     */
    @property({
        type: 'string',
        id: true,
        defaultFn: 'uuidv4'
    })
    id: string;

    /**
     * The id of the recipient of the invoice.
     */
    @property({
        type: 'string',
        required: true
    })
    recipientId: string;

    /**
     * The amount of invoices of that year.
     */
    @property({
        type: 'number',
        required: true
    })
    number: number;

    /**
     * The year for which this entity hold the amount of invoices.
     */
    @property({
        type: 'number',
        required: true
    })
    year: number;

    constructor(data?: Partial<NumberInvoices>) {
        super(data);
    }
}

/**
 * All relations.
 */
export interface NumberInvoicesRelations {
    // describe navigational properties here
}

/**
 * The entity with all its relations.
 */
export type NumberInvoicesWithRelations = NumberInvoices & NumberInvoicesRelations;