package com.ffii.fpsms.modules.master.web

import com.ffii.fpsms.modules.master.entity.ShopRepository
import com.ffii.fpsms.modules.master.entity.Shop
import com.ffii.fpsms.modules.master.entity.projections.ShopAndTruck

import com.ffii.fpsms.modules.master.entity.projections.ShopCombo
import com.ffii.fpsms.modules.master.enums.ShopType
import com.ffii.fpsms.modules.master.service.ShopService
import com.ffii.fpsms.modules.pickOrder.entity.Truck
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/shop")
class ShopController (
    private val shopService: ShopService,
) {
    @GetMapping("/combo/shop")
    fun getShopCombo(): List<ShopCombo> {
        return shopService.findShopCombo();
    }

    @GetMapping("/combo/supplier")
    fun getSupplierCombo(): List<ShopCombo> {
        return shopService.findSupplierCombo();
    }


    @GetMapping("/combo/allShop")
    fun test3(): List<ShopAndTruck>? {
        return shopService.findAllByTypeAndDeletedIsFalse();
    }

}