Emgmbh\MarketBundle\Entity\Market:
    type: entity
    repositoryClass: MarketRepository
    indexes:
        team:
            columns:
                - team
    id:
        number:
            type: string
            nullable: false
            length: 10
            id: true
            generator:
                strategy: NONE
    fields:
        postcode:
            type: string
            nullable: false
        city:
            type: string
            nullable: false
            length: 50
        address:
            type: string
            nullable: false
            length: 100
        manager:
            type: string
            nullable: false
            length: 20
        orderingRate:
            type: float
            nullable: false
        team:
            type: string
            nullable: false
            length: 50
        rilaNumber:
            type: integer
            nullable: false
            options:
                unsigned: false
        newspapers:
            type: float
            nullable: true
        weeklyPaper:
            type: float
            nullable: true
        kmDistrict:
            type: float
            nullable: true
        travelCost:
            type: float
            nullable: true

    lifecycleCallbacks: {  }

    oneToOne:
        responsibility:
            targetEntity: Emgmbh\MarketBundle\Entity\MarketResponsibility
            mappedBy: market
            fetch: LAZY

    manyToOne:
        districtManager:
            targetEntity: Emgmbh\UserBundle\Entity\Manager
            cascade: {  }
            fetch: EAGER
            inversedBy: districtMarkets
            orphanRemoval: false

        salesManager:
            targetEntity: Emgmbh\UserBundle\Entity\Manager
            cascade: {  }
            fetch: EAGER
            inversedBy: salesMarkets
            orphanRemoval: false

    oneToMany:
        hours:
            targetEntity: MarketHour
            mappedBy: market
            indexBy: weekDay
        workingPlans:
            targetEntity: Emgmbh\MarketBundle\Entity\MarketWorkingPlan
            mappedBy: market
            orderBy: {'year': 'DESC', 'month': 'DESC'}

    manyToMany:
        costGroups:
            targetEntity: Emgmbh\ReportBundle\Entity\CostGroup
            mappedBy: markets
