package com.ffii.fpsms.m18

import org.springframework.beans.factory.annotation.Value
import org.springframework.cloud.context.config.annotation.RefreshScope
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration


@Configuration
open class M18Config {

    // Account
//    @Value("\${m18.config.grant-type}")
    var GRANT_TYPE: String = "password";

//    @Value("\${m18.config.client-id}")
    var CLIENT_ID: String = "M2Y1OGYxMmQtZDRiOS00OTA4LTgyNTktZDRkNzEzNWVkMzRm";

//    @Value("\${m18.config.client-secret}")
    var CLIENT_SECRET: String = "M2Y2YjQzYzQtZTc2Mi00OTFhLTkwYmItYmJhMzFjZjEyYmY5";

//    @Value("\${m18.config.username}")
    var USERNAME: String = "testingMTMS";

//    @Value("\${m18.config.password}")
    var PASSWORD: String = "db25f2fc14cd2d2b1e7af307241f548fb03c312a";

    var BASE_URL: String = "http://16.162.251.126/jsf/rfws"

    // Supplier
//    @Value("\${m18.config.supplier-not.material-po}")
//    var MATERIAL_PO_SUPPLIER_NOT: List<String> = listOf("P06", "P07", "T62"); // If need oem type
    var MATERIAL_PO_SUPPLIER_NOT: List<String> = listOf("P06", "P07");

//    @Value("\${m18.config.supplier.shop-po}")
    var SHOP_PO_SUPPLIER: List<String> = listOf("P06", "P07");

//    @Value("\${m18.config.supplier.oem-po}")
    var OEM_PO_SUPPLIER: List<String> = listOf("T62");

    // Series
//    @Value("\${m18.config.seriesId.pp}")
    var SERIESID_PP: Long = 26;

//    @Value("\${m18.config.seriesId.pf}")
    var SERIESID_PF: Long = 33;

//    @Value("\${m18.config.seriesId.sc}")
    var SERIESID_SC: Long = 27;

//    @Value("\${m18.config.seriesId.se}")
    var SERIESID_SE: Long = 28;

//    @Value("\${m18.config.seriesId.sf}")
    var SERIESID_SF: Long = 70;

//    @Value("\${m18.config.seriesId.sr}")
    var SERIESID_SR: Long = 29;

    // BE
//    @Value("\${m18.config.beId.pp}")
    var BEID_PP: Long = 29;

//    @Value("\${m18.config.beId.pf}")
    var BEID_PF: Long = 27;

//    @Value("\${m18.config.beId.toa}")
    var BEID_TOA: Long = 1;

    // Fetch
    var ACCESS_TOKEN: String? = null;

    /**
     * Condition Detail
     * Conds Format:
     * Id=lessThan=5=and=id=largerOrEqual=3=or=(name=contains =ss=or=name=contains=bb)
     * Which means:
     * Id<5 and id >=3 or (name like ‘%ss%’ or name like ‘%bb%’)
     * **Please use these formats to write the conds: **
     * ("equal", "="),
     * ("unequal", "<>"),
     * ("largerThan", ">"),
     * ("lessThan", "<"),
     * ("largerOrEqual", ">="),
     * ("lessOrEqual", "<="),
     * ("contains", "like"),
     * ("doseNotContain", "notlike"),
     * ("in", "in"),
     * ("notIn", "notin"),
     * ("startWith", "like"),
     * ("endWith", "like");
     */
}