diff --git a/microservices/Cargo.lock b/microservices/Cargo.lock index 7428a2d4..a6815d09 100755 --- a/microservices/Cargo.lock +++ b/microservices/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" version = "2.0.1" @@ -40,15 +31,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned-vec" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" -dependencies = [ - "equator", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -149,9 +131,9 @@ checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "askama" -version = "0.16.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6024d73179f43f15ccd2b881bfea6fee7f3a46ec53f33b52210dea749ebebaa4" +checksum = "9b8246bcbf8eb97abef10c2d92166449680d41d55c0fc6978a91dec2e3619608" dependencies = [ "askama_macros", "itoa", @@ -162,13 +144,12 @@ dependencies = [ [[package]] name = "askama_derive" -version = "0.16.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071ee5ebf2138e3ad180e0aacf6940c2cab5e6d8333741d9925c7bee2b153f39" +checksum = "2f9670bc84a28bb3da91821ef74226949ab63f1265aff7c751634f1dd0e6f97c" dependencies = [ "askama_parser", "basic-toml", - "glob", "memchr", "proc-macro2", "pulldown-cmark", @@ -176,23 +157,23 @@ dependencies = [ "rustc-hash", "serde", "serde_derive", - "syn 3.0.9", + "syn 2.0.119", ] [[package]] name = "askama_macros" -version = "0.16.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643e1c7cbb6aec1d920332fe51a7c0d8219e273dcb8602db03f5263e4d16487b" +checksum = "f0756b45480437dded0565dfc568af62ccce146fb6cfe902e808ba86e445f44f" dependencies = [ "askama_derive", ] [[package]] name = "askama_parser" -version = "0.16.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5ae75772275d268b03ab8bdccdd12117b6169ee23256942b34e46c9f476583" +checksum = "5d0af3691ba3af77949c0b5a3925444b85cb58a0184cc7fec16c68ba2e7be868" dependencies = [ "rustc-hash", "serde", @@ -306,21 +287,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide 0.8.9", - "object", - "rustc-demangle", - "windows-link", -] - [[package]] name = "base16ct" version = "0.2.0" @@ -444,12 +410,15 @@ dependencies = [ [[package]] name = "brrtrouter" version = "0.1.0-alpha.1" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/BRRTRouter.git?rev=cb10df40d46c83811aa5a3016388e5b92af8df6a#cb10df40d46c83811aa5a3016388e5b92af8df6a" +======= +>>>>>>> Stashed changes dependencies = [ "anyhow", "arc-swap", "askama", - "base64 0.23.1", + "base64 0.22.1", "clap", "dashmap", "flate2", @@ -457,8 +426,7 @@ dependencies = [ "http 0.2.12", "http 1.5.0", "jsonschema", - "jsonwebtoken", - "libc", + "jsonwebtoken 10.4.0", "lru", "may", "may_minihttp", @@ -473,7 +441,7 @@ dependencies = [ "opentelemetry", "opentelemetry-semantic-conventions", "opentelemetry_sdk", - "prost 0.14.4", + "prost", "regex", "rustls", "rustls-native-certs", @@ -500,12 +468,15 @@ dependencies = [ [[package]] name = "brrtrouter_macros" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/BRRTRouter.git?rev=cb10df40d46c83811aa5a3016388e5b92af8df6a#cb10df40d46c83811aa5a3016388e5b92af8df6a" +======= +>>>>>>> Stashed changes dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 3.0.9", + "syn 2.0.119", ] [[package]] @@ -637,7 +608,11 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ +<<<<<<< Updated upstream "windows-sys 0.61.2", +======= + "windows-sys 0.52.0", +>>>>>>> Stashed changes ] [[package]] @@ -720,35 +695,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "cookie" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - -[[package]] -name = "cookie_store" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" -dependencies = [ - "cookie", - "document-features", - "idna", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -782,15 +728,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" -[[package]] -name = "cpp_demangle" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bb79cb74d735044c972aae58ed0aaa9a837e85b01106a54c39e42e97f62253" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -1038,15 +975,6 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - [[package]] name = "defmt" version = "1.2.0" @@ -1182,15 +1110,6 @@ dependencies = [ "const-random", ] -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "dotenv" version = "0.15.0" @@ -1342,26 +1261,6 @@ dependencies = [ "log", ] -[[package]] -name = "equator" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" -dependencies = [ - "equator-macro", -] - -[[package]] -name = "equator-macro" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "equivalent" version = "1.0.3" @@ -1410,21 +1309,15 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fancy-regex" -version = "0.19.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d301f5bf187b3c295fce6468d3875037a0bccc5f6b151c63cac2f85babf21912" +checksum = "72cf461f865c862bb7dc573f643dd6a2b6842f7c30b07882b56bd148cc2761b8" dependencies = [ "bit-set", "regex-automata", "regex-syntax", ] -[[package]] -name = "fastrand" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" - [[package]] name = "ff" version = "0.13.1" @@ -1453,24 +1346,6 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" -[[package]] -name = "findshlibs" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" -dependencies = [ - "cc", - "lazy_static", - "libc", - "winapi", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flate2" version = "1.1.10" @@ -1478,7 +1353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" dependencies = [ "crc32fast", - "miniz_oxide 0.9.1", + "miniz_oxide", "zlib-rs", ] @@ -1659,18 +1534,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "glob" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" - [[package]] name = "group" version = "0.13.0" @@ -1713,6 +1576,8 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ + "allocator-api2", + "equivalent", "foldhash", ] @@ -1721,11 +1586,14 @@ name = "hashbrown" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +<<<<<<< Updated upstream dependencies = [ "allocator-api2", "equivalent", "foldhash", ] +======= +>>>>>>> Stashed changes [[package]] name = "hashlink" @@ -2072,15 +1940,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -2096,23 +1955,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "jemalloc_pprof" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2dfa20a68824f4c8c1aa271617d0ee0d9b707a866d56b7d7ee39c60c235a8" -dependencies = [ - "anyhow", - "libc", - "mappings", - "once_cell", - "pprof_util", - "tempfile", - "tikv-jemalloc-ctl", - "tokio", - "tracing", -] - [[package]] name = "jiff" version = "0.2.38" @@ -2222,9 +2064,9 @@ dependencies = [ [[package]] name = "jsonschema" -version = "0.49.9" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ec8a241beed129f06114aa68007e905ca350e7baeb6e17a7631bb7978d91b2" +checksum = "257eb0e588b76827bbddc9e73945a9743693dd2adeaee9da26420f93cfedb798" dependencies = [ "ahash", "bytecount", @@ -2235,41 +2077,40 @@ dependencies = [ "getrandom 0.3.4", "idna", "itoa", - "jsonschema-regex", - "jsonschema-value", "num-cmp", "num-traits", "percent-encoding", "referencing", "regex", + "regex-syntax", "serde", "serde_json", - "strum", "unicode-general-category", "uuid-simd", ] [[package]] -name = "jsonschema-regex" -version = "0.49.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91994f45017ed5e66aa8e59b8415f4cb033a6380d7200387b7cf117595fbdf85" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "jsonschema-value" -version = "0.49.9" +name = "jsonwebtoken" +version = "10.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec7637f83e510868ae6ed625f7ebfbbde4554ee8ce49854caa5126a8b9b9ecb" +checksum = "eba32bfb4ffdeaca3e34431072faf01745c9b26d25504aa7a6cf5684334fc4fc" dependencies = [ - "ahash", - "bytecount", - "fraction", - "num-cmp", - "num-traits", + "base64 0.22.1", + "ed25519-dalek 2.2.0", + "getrandom 0.2.17", + "hmac 0.12.1", + "js-sys", + "p256", + "p384", + "pem 3.0.6", + "rand 0.8.8", + "rsa", + "serde", "serde_json", + "sha2 0.10.9", + "signature 2.2.0", + "simple_asn1", + "zeroize", ] [[package]] @@ -2279,18 +2120,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e75fe14a82d81e5f5af639997db37d8b96045938a7ac6ab18cdbe1c7467e05e1" dependencies = [ "base64 0.22.1", - "ed25519-dalek 2.2.0", "getrandom 0.2.17", - "hmac 0.12.1", "js-sys", - "p256", - "p384", "pem 3.0.6", - "rand 0.8.8", - "rsa", "serde", "serde_json", - "sha2 0.10.9", "signature 2.2.0", "simple_asn1", "zeroize", @@ -2322,7 +2156,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" dependencies = [ - "spin 0.9.9", + "spin", ] [[package]] @@ -2346,7 +2180,10 @@ checksum = "2e126dda6f34391ab7b444f9922055facc83c07a910da3eb16f1e4d9c45dc777" [[package]] name = "lifeguard" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/lifeguard.git?rev=44a2412232597d8b44c3b9f3d98689e7c9fa9547#44a2412232597d8b44c3b9f3d98689e7c9fa9547" +======= +>>>>>>> Stashed changes dependencies = [ "bytes", "chrono", @@ -2384,7 +2221,10 @@ dependencies = [ [[package]] name = "lifeguard-derive" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/lifeguard.git?rev=44a2412232597d8b44c3b9f3d98689e7c9fa9547#44a2412232597d8b44c3b9f3d98689e7c9fa9547" +======= +>>>>>>> Stashed changes dependencies = [ "proc-macro2", "quote", @@ -2394,7 +2234,10 @@ dependencies = [ [[package]] name = "lifeguard-migrate" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/lifeguard.git?rev=44a2412232597d8b44c3b9f3d98689e7c9fa9547#44a2412232597d8b44c3b9f3d98689e7c9fa9547" +======= +>>>>>>> Stashed changes dependencies = [ "anyhow", "chrono", @@ -2412,30 +2255,21 @@ dependencies = [ "sea-query", "serde", "serde_json", +<<<<<<< Updated upstream "sha2 0.10.9", +======= +>>>>>>> Stashed changes "thiserror 2.0.21", "toml", "uuid", ] -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - [[package]] name = "litemap" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" -[[package]] -name = "litrs" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" - [[package]] name = "lock_api" version = "0.4.14" @@ -2453,24 +2287,11 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "lru" -version = "0.19.0" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9f71e3591c7ec44d3e563e87bf14ddc2bada8519dca046e5b0e560cd004e2d" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" dependencies = [ - "hashbrown 0.17.1", -] - -[[package]] -name = "mappings" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bab1e61a4b76757edb59cd81fcaa7f3ba9018d43b527d9abfad877b4c6c60f2" -dependencies = [ - "anyhow", - "libc", - "once_cell", - "pprof_util", - "tracing", + "hashbrown 0.16.1", ] [[package]] @@ -2500,7 +2321,7 @@ dependencies = [ "libc", "log", "may_queue", - "nix 0.31.3", + "nix", "num_cpus", "parking_lot", "rustversion", @@ -2527,14 +2348,16 @@ dependencies = [ "once_cell", "rustls", "rustls-platform-verifier", - "tracing", "url", ] [[package]] name = "may_postgres" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/may_postgres.git?branch=integration%2Fmicroscaler-fork#0f9df0e6ad7d8aa1ade256c2c4e85b6132027a59" +======= +>>>>>>> Stashed changes dependencies = [ "byteorder", "bytes", @@ -2549,7 +2372,7 @@ dependencies = [ "rustls", "rustls-pemfile", "smallvec", - "spin 0.9.9", + "spin", ] [[package]] @@ -2568,10 +2391,7 @@ version = "0.1.1" source = "git+https://github.com/microscaler/may_tracing.git?tag=v0.1.1#121de43e6e5e96d45f3339a238150804070a4be8" dependencies = [ "may", - "opentelemetry", - "opentelemetry_sdk", "tracing", - "tracing-opentelemetry", ] [[package]] @@ -2591,13 +2411,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] -name = "memmap2" -version = "0.9.12" +name = "memo-map" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157" -dependencies = [ - "libc", -] +checksum = "5449c8c750f1a07ea702bbd212bd999fceece9b3d1508b17023b3e174583124b" [[package]] name = "memoffset" @@ -2618,35 +2435,20 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "micromap" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a86d3146ed3995b5913c414f6664344b9617457320782e64f0bb44afd49d74" - [[package]] name = "microscaler-observability" version = "0.1.0" -source = "git+https://github.com/microscaler/microscaler-observability.git?rev=2b7e35c7a64e5a70e035d1b4fc6527bd1ea2751f#2b7e35c7a64e5a70e035d1b4fc6527bd1ea2751f" dependencies = [ - "backtrace", - "base64 0.22.1", - "flate2", - "jemalloc_pprof", "opentelemetry", "opentelemetry-appender-tracing", "opentelemetry-otlp", "opentelemetry-semantic-conventions", "opentelemetry_sdk", - "pprof", - "serde_json", "thiserror 1.0.69", - "tikv-jemalloc-sys", "tokio", "tracing", "tracing-opentelemetry", "tracing-subscriber", - "ureq", ] [[package]] @@ -2675,10 +2477,11 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minijinja" -version = "3.0.3" +version = "2.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90086695417a271bc96e6cb50618555614ca48fa3bb0d9aa96e3468b0f84431e" +checksum = "86886cf6dbf4e614b19c9a1eec9775f021869d7eadde0fc73921a81b90c9b4c9" dependencies = [ + "memo-map", "serde", ] @@ -2688,15 +2491,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - [[package]] name = "miniz_oxide" version = "0.9.1" @@ -2719,29 +2513,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "multimap" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" - [[package]] name = "multiversion_no_op" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.31.3" @@ -2940,15 +2717,6 @@ dependencies = [ "yaml_serde", ] -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - [[package]] name = "oid-registry" version = "0.8.1" @@ -3013,7 +2781,7 @@ dependencies = [ "opentelemetry", "opentelemetry-proto", "opentelemetry_sdk", - "prost 0.14.4", + "prost", "thiserror 2.0.21", "tokio", "tonic", @@ -3040,7 +2808,7 @@ checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f" dependencies = [ "opentelemetry", "opentelemetry_sdk", - "prost 0.14.4", + "prost", "tonic", "tonic-prost", ] @@ -3131,12 +2899,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "pathdiff" version = "0.2.3" @@ -3179,6 +2941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] +<<<<<<< Updated upstream name = "petgraph" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3189,6 +2952,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> Stashed changes name = "phf" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3316,44 +3081,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" -[[package]] -name = "pprof" -version = "0.15.0" -source = "git+https://github.com/microscaler/pprof-rs.git?rev=ccc6819e45e2440eba00d3be572a1cb81b52ec5b#ccc6819e45e2440eba00d3be572a1cb81b52ec5b" -dependencies = [ - "aligned-vec", - "backtrace", - "cfg-if", - "findshlibs", - "libc", - "log", - "nix 0.26.4", - "once_cell", - "prost 0.12.6", - "prost-build", - "prost-derive 0.12.6", - "sha2 0.10.9", - "smallvec", - "spin 0.10.1", - "symbolic-demangle", - "tempfile", - "thiserror 2.0.21", -] - -[[package]] -name = "pprof_util" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea0cc524de808a6d98d192a3d99fe95617031ad4a52ec0a0f987ef4432e8fe1" -dependencies = [ - "anyhow", - "backtrace", - "flate2", - "num", - "paste", - "prost 0.14.4", -] - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -3363,16 +3090,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.119", -] - [[package]] name = "primeorder" version = "0.13.6" @@ -3415,16 +3132,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive 0.12.6", -] - [[package]] name = "prost" version = "0.14.4" @@ -3432,6 +3139,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", +<<<<<<< Updated upstream "prost-derive 0.14.4", ] @@ -3467,6 +3175,9 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.119", +======= + "prost-derive", +>>>>>>> Stashed changes ] [[package]] @@ -3476,21 +3187,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools", "proc-macro2", "quote", "syn 2.0.119", ] -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost 0.12.6", -] - [[package]] name = "protobuf" version = "3.7.2" @@ -3682,16 +3384,14 @@ dependencies = [ [[package]] name = "referencing" -version = "0.49.9" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6efa2154ea6f5ce0fdecdd2a8d18f2fa1a39a8fbba91564f555a592e4dce8278" +checksum = "e2f38748ceca8d0b0013e60f534d94a6e23dfd89fd2a88318fc5a2d04fda1010" dependencies = [ "ahash", "fluent-uri", "getrandom 0.3.4", - "hashbrown 0.17.1", - "itoa", - "micromap", + "hashbrown 0.16.1", "parking_lot", "percent-encoding", "serde_json", @@ -4314,7 +4014,7 @@ dependencies = [ "hmac 0.13.0", "http 0.2.12", "http 1.5.0", - "jsonwebtoken", + "jsonwebtoken 11.1.0", "lifeguard", "lifeguard-derive", "lifeguard-migrate", @@ -4772,12 +4472,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "rustc-demangle" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" - [[package]] name = "rustc-hash" version = "2.1.3" @@ -4802,19 +4496,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d" -dependencies = [ - "bitflags 2.13.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", -] - [[package]] name = "rustls" version = "0.23.46" @@ -5083,7 +4764,10 @@ dependencies = [ [[package]] name = "sesame-idam-client" version = "0.1.0" +<<<<<<< Updated upstream source = "git+https://github.com/microscaler/sesame-idam-client.git?rev=02ceb2bff70edb33fd5a98690aa7899fc0031f4e#02ceb2bff70edb33fd5a98690aa7899fc0031f4e" +======= +>>>>>>> Stashed changes dependencies = [ "base64 0.22.1", "brrtrouter", @@ -5092,7 +4776,7 @@ dependencies = [ "microscaler-timing", "serde", "serde_json", - "sha2 0.11.1", + "sha2 0.10.9", "urlencoding", "uuid", ] @@ -5142,9 +4826,9 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "signal-hook" -version = "0.4.5" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29ffa27d3d59a049bb328258de100f8012848d1b08d444e08bbc02ac468435e" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" dependencies = [ "libc", "signal-hook-registry", @@ -5250,15 +4934,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spin" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.3" @@ -5292,56 +4967,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "symbolic-common" -version = "12.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332615d90111d8eeaf86a84dc9bbe9f65d0d8c5cf11b4caccedc37754eb0dcfd" -dependencies = [ - "debugid", - "memmap2", - "stable_deref_trait", - "uuid", -] - -[[package]] -name = "symbolic-demangle" -version = "12.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912017718eb4d21930546245af9a3475c9dccf15675a5c215664e76621afc471" -dependencies = [ - "cpp_demangle", - "rustc-demangle", - "symbolic-common", -] - [[package]] name = "symlink" version = "0.1.0" @@ -5398,19 +5029,6 @@ dependencies = [ "syn 3.0.9", ] -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.3", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -5460,17 +5078,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "tikv-jemalloc-ctl" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a184c43b8ab2f41df2733b55556e3f5f632f4aeaa205b1bb018f574b7f5f142" -dependencies = [ - "libc", - "paste", - "tikv-jemalloc-sys", -] - [[package]] name = "tikv-jemalloc-sys" version = "0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8" @@ -5684,7 +5291,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", - "prost 0.14.4", + "prost", "tonic", ] @@ -5919,37 +5526,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "ureq" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde93ff05758a36a851a398a772b0b79a82fbe3c186a46f2696baaeaf84c966b" -dependencies = [ - "base64 0.23.1", - "cookie_store", - "log", - "percent-encoding", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "ureq-proto", - "utf8-zero", - "webpki-roots", -] - -[[package]] -name = "ureq-proto" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841583fc36089d7d59419568ae157f43a5a03a2e5a81ba87c77d1596ef46e922" -dependencies = [ - "base64 0.23.1", - "http 1.5.0", - "httparse", - "log", -] - [[package]] name = "url" version = "2.5.8" @@ -5969,12 +5545,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf8-zero" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -6127,15 +5697,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "webpki-roots" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/microservices/crm/pipeline/gen/doc/openapi.yaml b/microservices/crm/pipeline/gen/doc/openapi.yaml index bab82c3e..8e1d381e 100644 --- a/microservices/crm/pipeline/gen/doc/openapi.yaml +++ b/microservices/crm/pipeline/gen/doc/openapi.yaml @@ -5,7 +5,8 @@ x-brrtrouter-stack-size: 128KiB info: title: Pipeline version: v1.0.0 - description: Pipeline service — leads, opportunities, stages, lead conversion, pipeline summary. + description: Pipeline service - pipelines and stages, deals (contacts with roles, notes, files, activity, 1:1 email), leads + (the earlier Odoo-shaped lead model, still served), lead conversion, pipeline summary. x-api-version: CRM Pipeline API v1.0.0 x-crm-api-version: v1.0.0 termsOfService: https://rerp.example.com/terms @@ -21,91 +22,97 @@ info: openapi_version: 3.1.0 brrtrouter_version: latest servers: -- url: http://localhost:10352/api/v1/crm/pipeline - description: Local development (direct to service, port from port-registry) -- url: /api/v1/crm/pipeline - description: Pipeline API + - url: http://localhost:10352/api/v1/crm/pipeline + description: Local development (direct to service, port from port-registry) + - url: /api/v1/crm/pipeline + description: Pipeline API tags: -- name: lead-conversion - description: Lead-to-contact/account conversion -- name: lead-deduplication - description: Lead duplicate detection and merge -- name: lead-stages - description: Lead stage transitions -- name: leads - description: Lead and opportunity lifecycle -- name: pipeline-analytics - description: Pipeline summary and weighted forecasting -- name: pipeline-stage - description: Pipeline stage definitions -- name: stages - description: Pipeline stage management + - name: lead-conversion + description: Lead-to-contact/account conversion + - name: lead-deduplication + description: Lead duplicate detection and merge + - name: lead-stages + description: Lead stage transitions + - name: leads + description: Lead and opportunity lifecycle + - name: pipeline-analytics + description: Pipeline summary and weighted forecasting + - name: pipeline-stage + description: Pipeline stage definitions + - name: stages + description: Pipeline stage management + - name: pipelines + description: Pipelines, their summary and settings + - name: deals + description: 'Deals: contacts and roles, stage and status, notes, files, activity, 1:1 email' + - name: deal-roles + description: Roles a contact plays on a deal paths: /leads: get: operationId: list_leads summary: List leads and opportunities tags: - - leads + - leads parameters: - - name: page - in: query - schema: - type: integer - format: int32 - minimum: 1 - default: 1 - - name: limit - in: query - schema: - type: integer - format: int32 - minimum: 1 - maximum: 100 - default: 20 - - name: search - in: query - schema: - type: string - - name: filter_type - in: query - schema: - type: string - enum: - - LEAD - - OPPORTUNITY - - name: filter_stage_id - in: query - schema: - type: string - format: uuid - - name: filter_user_id - in: query - schema: - type: string - format: uuid - - name: filter_team_id - in: query - schema: - type: string - format: uuid - - name: filter_probability_gt - in: query - schema: - type: number - format: float - - name: filter_active - in: query - schema: - type: boolean - - name: filter_won_status - in: query - schema: - type: string - enum: - - PENDING - - WON - - LOST + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 20 + - name: search + in: query + schema: + type: string + - name: filter_type + in: query + schema: + type: string + enum: + - LEAD + - OPPORTUNITY + - name: filter_stage_id + in: query + schema: + type: string + format: uuid + - name: filter_user_id + in: query + schema: + type: string + format: uuid + - name: filter_team_id + in: query + schema: + type: string + format: uuid + - name: filter_probability_gt + in: query + schema: + type: number + format: float + - name: filter_active + in: query + schema: + type: boolean + - name: filter_won_status + in: query + schema: + type: string + enum: + - PENDING + - WON + - LOST responses: '200': description: List of leads @@ -116,20 +123,19 @@ paths: examples: default: items: - - &id001 - id: 00000000-0000-0000-0000-000000000001 - name: John Doe - email: john@example.com - phone: +1-555-0123 - company: Acme Corp - status: new - stage: discovery - score: 45 - source: website - assigned_to: 00000000-0000-0000-0000-000000000010 - created_at: '2024-01-15T10:30:00Z' - updated_at: '2024-01-15T10:30:00Z' - properties: {} + - id: 00000000-0000-0000-0000-000000000001 + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + status: new + stage: discovery + score: 45 + source: website + assigned_to: 00000000-0000-0000-0000-000000000010 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' + properties: {} total: 1 page: 1 per_page: 20 @@ -142,7 +148,7 @@ paths: '404': description: Resource not found security: - - bearerAuth: [] + - bearerAuth: [] description: Get leads associated with a campaign x-operation-id: get_leads_list x-controller: rerp_crm::pipeline::controller::leads @@ -151,7 +157,7 @@ paths: operationId: create_lead summary: Create a new lead or opportunity tags: - - leads + - leads requestBody: required: true content: @@ -159,7 +165,7 @@ paths: schema: $ref: '#/components/schemas/CreateLeadRequest' examples: - default: &id002 + default: name: John Doe email: john@example.com phone: +1-555-0123 @@ -174,7 +180,20 @@ paths: schema: $ref: '#/components/schemas/Lead' examples: - default: *id001 + default: + id: 00000000-0000-0000-0000-000000000001 + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + status: new + stage: discovery + score: 45 + source: website + assigned_to: 00000000-0000-0000-0000-000000000010 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' + properties: {} '400': description: Invalid request '401': @@ -188,7 +207,7 @@ paths: '404': description: Not found security: - - bearerAuth: [] + - bearerAuth: [] description: Get leads associated with a campaign x-operation-id: post_leads_list x-controller: rerp_crm::pipeline::controller::leads @@ -198,14 +217,14 @@ paths: operationId: get_lead summary: Get lead by id tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid responses: '200': description: Lead details @@ -214,7 +233,20 @@ paths: schema: $ref: '#/components/schemas/Lead' examples: - default: *id001 + default: + id: 00000000-0000-0000-0000-000000000001 + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + status: new + stage: discovery + score: 45 + source: website + assigned_to: 00000000-0000-0000-0000-000000000010 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' + properties: {} '404': description: Not found '401': @@ -222,7 +254,7 @@ paths: '500': description: Internal server error security: - - bearerAuth: [] + - bearerAuth: [] description: Get leads by ID x-operation-id: get_id_by_id x-controller: rerp_crm::pipeline::controller::leads::id @@ -231,14 +263,14 @@ paths: operationId: update_lead summary: Update lead fields tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid requestBody: required: true content: @@ -246,7 +278,12 @@ paths: schema: $ref: '#/components/schemas/UpdateLeadRequest' examples: - default: *id002 + default: + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + source: website description: Update an existing lead responses: '200': @@ -256,7 +293,20 @@ paths: schema: $ref: '#/components/schemas/Lead' examples: - default: *id001 + default: + id: 00000000-0000-0000-0000-000000000001 + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + status: new + stage: discovery + score: 45 + source: website + assigned_to: 00000000-0000-0000-0000-000000000010 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' + properties: {} '400': description: Invalid request '404': @@ -284,7 +334,7 @@ paths: '401': description: Unauthorized - Invalid or missing authentication token security: - - bearerAuth: [] + - bearerAuth: [] x-brrtrouter-impl: true description: Update leads by ID x-operation-id: put_id_by_id @@ -294,14 +344,14 @@ paths: operationId: delete_lead summary: Soft-delete lead tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid responses: '204': description: Lead deleted @@ -322,7 +372,7 @@ paths: '401': description: Unauthorized - Invalid or missing authentication token security: - - bearerAuth: [] + - bearerAuth: [] description: Delete leads by ID x-operation-id: delete_id_by_id x-controller: rerp_crm::pipeline::controller::leads::id @@ -332,14 +382,14 @@ paths: operationId: change_stage summary: Move lead to a new pipeline stage tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid requestBody: required: true content: @@ -347,7 +397,7 @@ paths: schema: $ref: '#/components/schemas/StageChangeRequest' examples: - default: &id003 + default: name: Discovery order: 1 pipeline_id: 00000000-0000-0000-0000-000000000005 @@ -360,7 +410,20 @@ paths: schema: $ref: '#/components/schemas/Lead' examples: - default: *id001 + default: + id: 00000000-0000-0000-0000-000000000001 + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + status: new + stage: discovery + score: 45 + source: website + assigned_to: 00000000-0000-0000-0000-000000000010 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' + properties: {} '400': description: Invalid stage transition '404': @@ -388,7 +451,7 @@ paths: '401': description: Unauthorized - Invalid or missing authentication token security: - - bearerAuth: [] + - bearerAuth: [] x-brrtrouter-impl: true description: Partially update leads by ID x-operation-id: patch_stage_by_id @@ -399,14 +462,14 @@ paths: operationId: convert_lead summary: 'Convert a lead: it crosses into RERP as a customer' tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid requestBody: required: true description: Why the lead converted, and the billing details RERP needs @@ -440,12 +503,11 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' security: - - bearerAuth: [] + - bearerAuth: [] x-brrtrouter-impl: true - description: Marks the lead won and publishes a signed conversion to RERP (ADR 003). Only a converted customer - crosses from the marketing funnel; RERP creates the customer (a CRM account) when it pulls the conversion, so - the crossing is asynchronous. Converting the same lead again republishes the same conversion and creates nothing - new. + description: Marks the lead won and publishes a signed conversion to RERP (ADR 003). Only a converted customer crosses + from the marketing funnel; RERP creates the customer (a CRM account) when it pulls the conversion, so the crossing + is asynchronous. Converting the same lead again republishes the same conversion and creates nothing new. x-operation-id: post_leads_convert x-controller: rerp_crm::pipeline::controller::leads::id::convert x-handler-name: leads_id_convert @@ -454,7 +516,7 @@ paths: operationId: detect_duplicates summary: Detect duplicate leads by email/phone/name tags: - - leads + - leads requestBody: required: true content: @@ -474,8 +536,8 @@ paths: lead_id: 00000000-0000-0000-0000-000000000001 duplicates_found: 2 duplicate_ids: - - 00000000-0000-0000-0000-000000000030 - - 00000000-0000-0000-0000-000000000031 + - 00000000-0000-0000-0000-000000000030 + - 00000000-0000-0000-0000-000000000031 confidence: 0.92 '400': description: Invalid request @@ -499,8 +561,8 @@ paths: default: is_duplicate: true matches: - - id: 00000000-0000-0000-0000-000000000004 - confidence: 0.95 + - id: 00000000-0000-0000-0000-000000000004 + confidence: 0.95 '401': description: Unauthorized - Invalid or missing authentication token '404': @@ -508,7 +570,7 @@ paths: '409': description: Conflict - resource conflict or cannot complete action security: - - bearerAuth: [] + - bearerAuth: [] description: Create a new leads x-operation-id: post_detect-duplicates x-controller: rerp_crm::pipeline::controller::leads::detect-duplicates @@ -518,14 +580,14 @@ paths: operationId: merge_leads summary: Merge two leads (keep one, archive other, combine data) tags: - - leads + - leads parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid requestBody: required: true content: @@ -533,7 +595,12 @@ paths: schema: $ref: '#/components/schemas/MergeLeadsRequest' examples: - default: *id002 + default: + name: John Doe + email: john@example.com + phone: +1-555-0123 + company: Acme Corp + source: website description: Merge duplicate leads responses: '200': @@ -546,12 +613,12 @@ paths: default: primary_id: 00000000-0000-0000-0000-000000000002 merged_from: - - 00000000-0000-0000-0000-000000000032 - - 00000000-0000-0000-0000-000000000033 + - 00000000-0000-0000-0000-000000000032 + - 00000000-0000-0000-0000-000000000033 fields_merged: - - email - - phone - - company + - email + - phone + - company '400': description: Invalid request '500': @@ -582,7 +649,7 @@ paths: '409': description: Conflict - resource conflict or cannot complete action security: - - bearerAuth: [] + - bearerAuth: [] description: Perform an action on leads x-operation-id: post_leads_merge x-controller: rerp_crm::pipeline::controller::leads::id::merge @@ -592,13 +659,13 @@ paths: operationId: pipeline_summary summary: Get pipeline summary grouped by stage tags: - - leads + - leads parameters: - - name: team_id - in: query - schema: - type: string - format: uuid + - name: team_id + in: query + schema: + type: string + format: uuid responses: '200': description: Pipeline summary @@ -609,14 +676,14 @@ paths: examples: default: items: - - total_leads: 150 - stage_breakdown: - discovery: 45 - qualified: 35 - proposal: 25 - negotiation: 30 - weighted_value: 375000 - forecast: 420000 + - total_leads: 150 + stage_breakdown: + discovery: 45 + qualified: 35 + proposal: 25 + negotiation: 30 + weighted_value: 375000 + forecast: 420000 total: 1 page: 1 per_page: 20 @@ -629,7 +696,7 @@ paths: '500': description: Internal server error security: - - bearerAuth: [] + - bearerAuth: [] description: List all pipeline x-operation-id: get_summary x-controller: rerp_crm::pipeline::controller::pipeline::summary @@ -639,28 +706,28 @@ paths: operationId: list_stages summary: List pipeline stages ordered by sequence tags: - - stages + - stages parameters: - - name: page - in: query - schema: - type: integer - format: int32 - minimum: 1 - default: 1 - - name: limit - in: query - schema: - type: integer - format: int32 - minimum: 1 - maximum: 100 - default: 50 - - name: filter_team_id - in: query - schema: - type: string - format: uuid + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: filter_team_id + in: query + schema: + type: string + format: uuid responses: '200': description: List of stages @@ -671,13 +738,12 @@ paths: examples: default: items: - - &id004 - id: 00000000-0000-0000-0000-000000000004 - name: Discovery - order: 1 - pipeline_id: 00000000-0000-0000-0000-000000000005 - created_at: '2024-01-15T10:30:00Z' - updated_at: '2024-01-15T10:30:00Z' + - id: 00000000-0000-0000-0000-000000000004 + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' total: 1 page: 1 per_page: 20 @@ -690,7 +756,7 @@ paths: '500': description: Internal server error security: - - bearerAuth: [] + - bearerAuth: [] description: List all stages x-operation-id: get_stages_list x-controller: rerp_crm::pipeline::controller::stages @@ -699,7 +765,7 @@ paths: operationId: create_stage summary: Create a new pipeline stage tags: - - stages + - stages requestBody: required: true content: @@ -707,7 +773,10 @@ paths: schema: $ref: '#/components/schemas/CreateStageRequest' examples: - default: *id003 + default: + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 description: Create a new pipeline stage responses: '201': @@ -717,7 +786,13 @@ paths: schema: $ref: '#/components/schemas/Stage' examples: - default: *id004 + default: + id: 00000000-0000-0000-0000-000000000004 + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' '400': description: Invalid request '500': @@ -731,7 +806,7 @@ paths: '404': description: Not found security: - - bearerAuth: [] + - bearerAuth: [] description: Create a new stages x-operation-id: post_stages_list x-controller: rerp_crm::pipeline::controller::stages @@ -741,14 +816,14 @@ paths: operationId: get_stage summary: Get stage by id tags: - - stages + - stages parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid responses: '200': description: Stage details @@ -757,7 +832,13 @@ paths: schema: $ref: '#/components/schemas/Stage' examples: - default: *id004 + default: + id: 00000000-0000-0000-0000-000000000004 + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' '404': description: Not found '401': @@ -765,7 +846,7 @@ paths: '500': description: Internal server error security: - - bearerAuth: [] + - bearerAuth: [] description: Get stages by ID x-operation-id: get_id_by_id x-controller: rerp_crm::pipeline::controller::stages::id @@ -774,14 +855,14 @@ paths: operationId: update_stage summary: Update stage fields tags: - - stages + - stages parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid requestBody: required: true content: @@ -789,7 +870,10 @@ paths: schema: $ref: '#/components/schemas/UpdateStageRequest' examples: - default: *id003 + default: + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 description: Update a pipeline stage responses: '200': @@ -799,7 +883,13 @@ paths: schema: $ref: '#/components/schemas/Stage' examples: - default: *id004 + default: + id: 00000000-0000-0000-0000-000000000004 + name: Discovery + order: 1 + pipeline_id: 00000000-0000-0000-0000-000000000005 + created_at: '2024-01-15T10:30:00Z' + updated_at: '2024-01-15T10:30:00Z' '400': description: Invalid request '404': @@ -827,7 +917,7 @@ paths: '401': description: Unauthorized - Invalid or missing authentication token security: - - bearerAuth: [] + - bearerAuth: [] description: Update stages by ID x-operation-id: put_id_by_id x-controller: rerp_crm::pipeline::controller::stages::id @@ -836,14 +926,14 @@ paths: operationId: delete_stage summary: Delete stage (only if no leads in it) tags: - - stages + - stages parameters: - - name: id - in: path - required: true - schema: - type: string - format: uuid + - name: id + in: path + required: true + schema: + type: string + format: uuid responses: '204': description: Stage deleted @@ -866,689 +956,3127 @@ paths: '401': description: Unauthorized - Invalid or missing authentication token security: - - bearerAuth: [] + - bearerAuth: [] description: Delete stages by ID x-operation-id: delete_id_by_id x-controller: rerp_crm::pipeline::controller::stages::id x-handler-name: stages_id -components: - schemas: - Lead: - type: object - required: - - id - - name - - type - - create_date - - active - properties: - id: - type: string - format: uuid - name: - type: string - maxLength: 255 - type: - type: string - enum: - - LEAD - - OPPORTUNITY - description: LEAD = qualification, OPPORTUNITY = pipeline - email_from: - type: string - format: email - maxLength: 255 - email_normalized: - type: string - maxLength: 255 - phone: - type: string - maxLength: 64 - phone_sanitized: - type: string - maxLength: 64 - mobile: - type: string - maxLength: 64 - title: - type: string - enum: - - MR - - MRS - - MME - description: Salutation - function: - type: string - maxLength: 128 - contact_name: - type: string - maxLength: 255 - company_name: - type: string - maxLength: 255 - website: - type: string - format: uri - maxLength: 255 - description: - type: string - referred_by: - type: string - maxLength: 255 - priority: - type: string - enum: - - LOW - - NORMAL - - HIGH - - URGENT - active: - type: boolean - is_blacklisted: - type: boolean - color: - type: integer - format: int32 - minimum: 1 - maximum: 16 - stage_id: - type: string - format: uuid - description: Current pipeline stage - tag_ids: - type: array - items: + /pipelines: + get: + operationId: list_pipelines + summary: List pipelines + tags: + - pipelines + parameters: + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPipeline' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: list_pipelines + post: + operationId: create_pipeline + summary: Create a pipeline + tags: + - pipelines + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: create_pipeline + /pipelines/{id}: + get: + operationId: get_pipeline + summary: Get a pipeline + tags: + - pipelines + parameters: + - name: id + in: path + required: true + schema: type: string format: uuid - probability: - type: number - format: float - minimum: 0 - maximum: 100 - automated_probability: - type: number - format: float - minimum: 0 - maximum: 100 - is_automated_probability: - type: boolean - date_deadline: - type: string - format: date - date_open: - type: string - format: date-time - readOnly: true - date_closed: - type: string - format: date-time - readOnly: true - date_last_stage_update: - type: string - format: date-time - readOnly: true - day_open: + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: get_pipeline + put: + operationId: update_pipeline + summary: Replace a pipeline + tags: + - pipelines + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: update_pipeline + patch: + operationId: patch_pipeline + summary: Update part of a pipeline + tags: + - pipelines + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Pipeline' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: patch_pipeline + delete: + operationId: delete_pipeline + summary: Delete a pipeline + tags: + - pipelines + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: delete_pipeline + /pipelines/{id}/summary: + get: + operationId: get_pipeline_summary + summary: Open deals, value, weighted value, won this month, stalled, per stage + tags: + - pipelines + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineSummary' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: get_pipeline_summary + /deals: + get: + operationId: list_deals + summary: List deals + tags: + - deals + parameters: + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + - name: pipeline_id + in: query + schema: + type: string + format: uuid + - name: stage_id + in: query + schema: + type: string + format: uuid + - name: status + in: query + schema: + $ref: '#/components/schemas/DealStatus' + - name: owner_id + in: query + schema: + type: string + - name: contact_id + in: query + schema: + type: string + format: uuid + - name: company_id + in: query + schema: + type: string + format: uuid + - name: tag_id + in: query + schema: + type: string + format: uuid + - name: stalled + in: query + schema: + type: boolean + - name: expected_close_from + in: query + schema: + type: string + format: date + - name: expected_close_to + in: query + schema: + type: string + format: date + - name: value_min + in: query + schema: + type: number + - name: value_max + in: query + schema: + type: number + - name: sort + in: query + schema: + type: string + enum: + - next_task_at + - value + - created_at + - updated_at + - expected_close_at + - title + - name: dir + in: query + schema: + type: string + enum: + - asc + - desc + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedDeal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: list_deals + post: + operationId: create_deal + summary: Create a deal + tags: + - deals + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDealRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: create_deal + /deals/{id}: + get: + operationId: get_deal + summary: Get a deal + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: get_deal + put: + operationId: update_deal + summary: Replace a deal + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDealRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: update_deal + patch: + operationId: patch_deal + summary: Update part of a deal + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDealRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: patch_deal + delete: + operationId: delete_deal + summary: Delete a deal + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: delete_deal + /deals/{id}/stage: + patch: + operationId: change_deal_stage + summary: Move a deal to a stage (or another pipeline); fires DEAL_STAGE_CHANGE / ENTERED_PIPELINE + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealStageChangeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: change_deal_stage + /deals/{id}/status: + patch: + operationId: change_deal_status + summary: Mark a deal won, lost or open again; WON emits the signed conversion (ADR 003) and fires DEAL_WON + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealStatusChangeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: change_deal_status + /deals/{id}/contacts: + post: + operationId: add_deal_contact + summary: Attach a contact with a role; the first one becomes primary + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealContact' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: add_deal_contact + /deals/{id}/contacts/{contact_id}: + patch: + operationId: update_deal_contact + summary: Change a contact's role or make it primary + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: contact_id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealContact' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Deal' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: update_deal_contact + delete: + operationId: remove_deal_contact + summary: Detach a contact + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: contact_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: remove_deal_contact + /deals/{id}/notes: + get: + operationId: list_deal_notes + summary: Notes on a deal, newest first + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedNote' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: list_deal_notes + post: + operationId: add_deal_note + summary: Add a note + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NoteRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: add_deal_note + /deals/{id}/notes/{note_id}: + patch: + operationId: update_deal_note + summary: Edit or pin a note + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: note_id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NoteRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Note' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: update_deal_note + delete: + operationId: delete_deal_note + summary: Delete a note + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: note_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: delete_deal_note + /deals/{id}/files: + get: + operationId: list_deal_files + summary: Files on a deal + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAttachment' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: list_deal_files + post: + operationId: upload_deal_file + summary: Upload a file (multipart) + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: upload_deal_file + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + /deals/{id}/files/{file_id}: + delete: + operationId: delete_deal_file + summary: Delete a file + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: file_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: delete_deal_file + /deals/{id}/activity: + get: + operationId: list_deal_activity + summary: 'The deal''s timeline: changes, notes, files, tasks, emails, workflow actions' + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + - name: kind + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedActivityEntry' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: list_deal_activity + /deals/{id}/emails: + get: + operationId: list_deal_emails + summary: 1:1 emails on the deal (sent through connected mailboxes, and replies) + tags: + - deals + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedDealEmail' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: list_deal_emails + post: + operationId: send_deal_email + summary: Send a 1:1 email from the caller's connected mailbox, optionally from a saved response + tags: + - deals + description: 422 NO_CONNECTED_MAILBOX when the caller has none (crm/platform /mailboxes). + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SendDealEmailRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/DealEmail' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: send_deal_email + /deals/bulk: + post: + operationId: bulk_update_deals + summary: Move, assign, set status, tag or delete many deals + tags: + - deals + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDealRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + updated: + type: integer + skipped: + type: array + items: + type: object + properties: + deal_id: + type: string + format: uuid + reason: + type: string + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deals + x-handler-name: bulk_update_deals + /deal-roles: + get: + operationId: list_deal_roles + summary: List deal roles + tags: + - deal-roles + parameters: + - name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + - name: limit + in: query + schema: + type: integer + format: int32 + minimum: 1 + maximum: 100 + default: 50 + - name: search + in: query + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedDealRole' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: list_deal_roles + post: + operationId: create_deal_role + summary: Create a deal role + tags: + - deal-roles + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealRoleRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/DealRole' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: create_deal_role + /deal-roles/{id}: + get: + operationId: get_deal_role + summary: Get a deal role + tags: + - deal-roles + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DealRole' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: get_deal_role + put: + operationId: update_deal_role + summary: Replace a deal role + tags: + - deal-roles + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealRoleRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DealRole' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: update_deal_role + patch: + operationId: patch_deal_role + summary: Update part of a deal role + tags: + - deal-roles + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealRoleRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DealRole' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: patch_deal_role + delete: + operationId: delete_deal_role + summary: Delete a deal role + tags: + - deal-roles + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: No content + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::deal_roles + x-handler-name: delete_deal_role + /settings: + get: + operationId: get_deal_settings + summary: Deal settings and the win-probability readiness per pipeline + tags: + - pipelines + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DealSettings' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: get_deal_settings + put: + operationId: update_deal_settings + summary: Update deal settings + tags: + - pipelines + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DealSettings' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DealSettings' + '401': + description: Unauthorized + '404': + description: Not found + '422': + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - bearerAuth: [] + x-controller: rerp_crm::pipeline::controller::pipelines + x-handler-name: update_deal_settings +components: + schemas: + Lead: + type: object + required: + - id + - name + - type + - create_date + - active + properties: + id: + type: string + format: uuid + name: + type: string + maxLength: 255 + type: + type: string + enum: + - LEAD + - OPPORTUNITY + description: LEAD = qualification, OPPORTUNITY = pipeline + email_from: + type: string + format: email + maxLength: 255 + email_normalized: + type: string + maxLength: 255 + phone: + type: string + maxLength: 64 + phone_sanitized: + type: string + maxLength: 64 + mobile: + type: string + maxLength: 64 + title: + type: string + enum: + - MR + - MRS + - MME + description: Salutation + function: + type: string + maxLength: 128 + contact_name: + type: string + maxLength: 255 + company_name: + type: string + maxLength: 255 + website: + type: string + format: uri + maxLength: 255 + description: + type: string + referred_by: + type: string + maxLength: 255 + priority: + type: string + enum: + - LOW + - NORMAL + - HIGH + - URGENT + active: + type: boolean + is_blacklisted: + type: boolean + color: + type: integer + format: int32 + minimum: 1 + maximum: 16 + stage_id: + type: string + format: uuid + description: Current pipeline stage + tag_ids: + type: array + items: + type: string + format: uuid + probability: + type: number + format: float + minimum: 0 + maximum: 100 + automated_probability: + type: number + format: float + minimum: 0 + maximum: 100 + is_automated_probability: + type: boolean + date_deadline: + type: string + format: date + date_open: + type: string + format: date-time + readOnly: true + date_closed: + type: string + format: date-time + readOnly: true + date_last_stage_update: + type: string + format: date-time + readOnly: true + day_open: + type: number + format: float + readOnly: true + day_close: type: number format: float readOnly: true - day_close: + expected_revenue: + type: number + format: double + prorated_revenue: + type: number + format: double + readOnly: true + recurring_revenue: + type: number + format: double + recurring_plan_id: + type: string + format: uuid + recurring_revenue_monthly: + type: number + format: double + readOnly: true + partner_id: + type: string + format: uuid + description: Linked contact record + company_id: + type: string + format: uuid + description: Parent company/account + user_id: + type: string + format: uuid + description: Assigned salesperson + team_id: + type: string + format: uuid + description: Sales team + campaign_id: + type: string + format: uuid + medium_id: + type: string + format: uuid + source_id: + type: string + format: uuid + won_status: + type: string + enum: + - PENDING + - WON + - LOST + lost_reason_id: + type: string + format: uuid + duplicate_lead_ids: + type: array + items: + type: string + format: uuid + duplicate_lead_count: + type: integer + format: int32 + create_date: + type: string + format: date-time + readOnly: true + write_date: + type: string + format: date-time + readOnly: true + write_uid: + type: string + format: uuid + stage_name: + type: string + readOnly: true + stage_probability: + type: integer + format: int32 + readOnly: true + stage_color: + type: integer + format: int32 + readOnly: true + is_rotting: + type: boolean + readOnly: true + description: A potential customer who has shown interest in our products or services + CreateLeadRequest: + type: object + required: + - name + properties: + name: + type: string + maxLength: 255 + type: + type: string + enum: + - LEAD + - OPPORTUNITY + default: LEAD + email_from: + type: string + format: email + email: + type: string + format: email + phone: + type: string + mobile: + type: string + title: + type: string + enum: + - MR + - MRS + - MME + function: + type: string + contact_name: + type: string + company_name: + type: string + website: + type: string + format: uri + description: + type: string + referred_by: + type: string + priority: + type: string + enum: + - LOW + - NORMAL + - HIGH + - URGENT + stage_id: + type: string + format: uuid + tag_ids: + type: array + items: + type: string + format: uuid + expected_revenue: + type: number + format: double + probability: type: number format: float - readOnly: true + minimum: 0 + maximum: 100 + user_id: + type: string + format: uuid + team_id: + type: string + format: uuid + partner_id: + type: string + format: uuid + company_id: + type: string + format: uuid + campaign_id: + type: string + format: uuid + medium_id: + type: string + format: uuid + source_id: + type: string + format: uuid + date_deadline: + type: string + format: date + recurring_plan_id: + type: string + format: uuid + recurring_revenue: + type: number + format: double + description: Request body for creating a new lead + UpdateLeadRequest: + type: object + properties: + name: + type: string + type: + type: string + enum: + - LEAD + - OPPORTUNITY + email_from: + type: string + email: + type: string + format: email + phone: + type: string + mobile: + type: string + title: + type: string + enum: + - MR + - MRS + - MME + function: + type: string + contact_name: + type: string + company_name: + type: string + website: + type: string + format: uri + description: + type: string + referred_by: + type: string + priority: + type: string + enum: + - LOW + - NORMAL + - HIGH + - URGENT + active: + type: boolean + stage_id: + type: string + format: uuid + tag_ids: + type: array + items: + type: string + format: uuid expected_revenue: type: number format: double - prorated_revenue: + probability: + type: number + format: float + user_id: + type: string + format: uuid + team_id: + type: string + format: uuid + partner_id: + type: string + format: uuid + company_id: + type: string + format: uuid + campaign_id: + type: string + format: uuid + medium_id: + type: string + format: uuid + source_id: + type: string + format: uuid + date_deadline: + type: string + format: date + lost_reason_id: + type: string + format: uuid + description: Request body for updating an existing lead (all fields optional; send only what changes) + Stage: + type: object + required: + - id + - name + - sequence + - probability + properties: + id: + type: string + format: uuid + name: + type: string + maxLength: 128 + sequence: + type: integer + format: int32 + probability: + type: integer + format: int32 + minimum: 0 + maximum: 100 + is_won: + type: boolean + is_lost: + type: boolean + rotting_threshold_days: + type: integer + format: int32 + minimum: 1 + description: Days before stage shows as stale + requirements: + type: string + description: Internal requirements/tooltip + team_ids: + type: array + items: + type: string + format: uuid + fold: + type: boolean + description: Collapsed lane on the board + color: + type: string + description: '#RRGGBB' + description: + type: string + lead_count: + type: integer + format: int32 + readOnly: true + pipeline_id: + type: string + format: uuid + rotting_days: + type: integer + format: int32 + description: Deals older than this in the stage are flagged stalled + card_fields: + type: array + items: + type: string + description: 'What the board card shows: title, next_task, owner, contact_company, value, custom: ...' + deal_order: + type: string + description: Default sort of cards in the lane, e.g. next_task asc, value desc + description: A pipeline stage representing a step in the sales process + CreateStageRequest: + type: object + required: + - name + - sequence + - probability + properties: + name: + type: string + maxLength: 128 + sequence: + type: integer + format: int32 + minimum: 1 + probability: + type: integer + format: int32 + minimum: 0 + maximum: 100 + is_won: + type: boolean + is_lost: + type: boolean + rotting_threshold_days: + type: integer + format: int32 + minimum: 1 + requirements: + type: string + team_ids: + type: array + items: + type: string + format: uuid + fold: + type: boolean + color: + type: integer + format: int32 + minimum: 1 + maximum: 16 + description: + type: string + description: Request body for creating a new pipeline stage + UpdateStageRequest: + type: object + properties: + name: + type: string + sequence: + type: integer + format: int32 + probability: + type: integer + format: int32 + is_won: + type: boolean + is_lost: + type: boolean + rotting_threshold_days: + type: integer + format: int32 + requirements: + type: string + team_ids: + type: array + items: + type: string + format: uuid + fold: + type: boolean + color: + type: integer + format: int32 + description: + type: string + required: + - name + - sequence + - probability + - is_won + - is_lost + - rotting_threshold_days + - requirements + - team_ids + - fold + - color + - description + description: Request body for updating an existing stage + StageChangeRequest: + type: object + required: + - stage_id + properties: + stage_id: + type: string + format: uuid + lost_reason_id: + type: string + format: uuid + description: Required when transitioning to a lost stage + comment: + type: string + description: Optional comment on stage change + description: Request body for transitioning a lead to a new stage + ConvertLeadRequest: + type: object + additionalProperties: false + required: + - reason + - reference + - customer + properties: + reason: + type: string + enum: + - order + - contract + description: An accepted quote or order, or a signed contract. Paid Stripe checkouts convert automatically. + reference: + type: string + minLength: 1 + maxLength: 200 + description: The order, quote or contract reference + customer: + $ref: '#/components/schemas/ConversionCustomer' + description: Request body for converting a lead (ADR 003) + ConversionResult: + type: object + required: + - lead_id + - conversion_id + - reason + - stage + properties: + lead_id: + type: string + format: uuid + conversion_id: + type: string + format: uuid + description: 'Deterministic per lead: a retry is the same conversion' + reason: + type: string + enum: + - order + - contract + stage: + type: string + description: The lead stage after conversion (converted) + message_id: + type: string + description: The Pub/Sub message id of the published conversion + description: A published conversion + DuplicateDetectionRequest: + type: object + properties: + email: + type: string + format: email + phone: + type: string + name: + type: string + required: + - email + - phone + - name + description: Request body for checking lead duplicates by email/phone/name + DuplicateDetectionResult: + type: object + properties: + duplicates: + type: array + items: + type: string + format: uuid + required: + - duplicates + description: Result of duplicate detection with matched records + MergeLeadsRequest: + type: object + required: + - keep_id + - merge_id + properties: + keep_id: + type: string + format: uuid + merge_id: + type: string + format: uuid + description: Request body for merging duplicate leads + MergeResult: + type: object + properties: + kept_id: + type: string + format: uuid + merged_id: + type: string + format: uuid + merged_tag_count: + type: integer + format: int32 + merged_description_additions: + type: integer + format: int32 + required: + - kept_id + - merged_id + - merged_tag_count + - merged_description_additions + description: Result of merging multiple records together + PaginatedResponse: + type: object + required: + - total + - page + - limit + properties: + total: + type: integer + format: int64 + page: + type: integer + format: int32 + limit: + type: integer + format: int32 + description: A generic paginated response wrapper with items and pagination metadata + ErrorResponse: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + description: HTTP error code + message: + type: string + description: Human-readable error message + details: + type: string + description: Additional error details + description: An error response with code, message, and optional details + PaginatedLead: + type: object + required: + - items + - total + - page + - limit + properties: + items: + type: array + items: + $ref: '#/components/schemas/Lead' + total: + type: integer + format: int64 + page: + type: integer + format: int32 + limit: + type: integer + format: int32 + description: Paginated list of Lead records + PaginatedStage: + type: object + required: + - items + - total + - page + - limit + properties: + items: + type: array + items: + $ref: '#/components/schemas/Stage' + total: + type: integer + format: int64 + page: + type: integer + format: int32 + limit: + type: integer + format: int32 + description: Paginated list of Stage records + PaginatedPipelineSummary: + type: object + required: + - total_opportunities + - total_revenue + - total_weighted_revenue + - stages + properties: + total_opportunities: + type: integer + format: int32 + total_revenue: type: number format: double - readOnly: true - recurring_revenue: + total_weighted_revenue: type: number format: double - recurring_plan_id: + stages: + type: array + items: + type: object + properties: + stage_id: + type: string + format: uuid + stage_name: + type: string + count: + type: integer + format: int32 + total_revenue: + type: number + format: double + weighted_revenue: + type: number + format: double + avg_days_in_stage: + type: number + format: float + description: Paginated list of PipelineSummary records + ConversionAddress: + type: object + additionalProperties: false + required: + - line1 + - city + - country + properties: + line1: type: string - format: uuid - recurring_revenue_monthly: - type: number - format: double - readOnly: true - partner_id: + minLength: 1 + maxLength: 200 + line2: type: string - format: uuid - description: Linked contact record - company_id: + minLength: 1 + maxLength: 200 + city: type: string - format: uuid - description: Parent company/account - user_id: + minLength: 1 + maxLength: 100 + postal_code: type: string - format: uuid - description: Assigned salesperson - team_id: + minLength: 1 + maxLength: 20 + region: type: string - format: uuid - description: Sales team - campaign_id: + minLength: 1 + maxLength: 100 + country: type: string - format: uuid - medium_id: + pattern: ^[A-Z]{2}$ + description: ISO 3166-1 alpha-2 + description: Billing address + ConversionCustomer: + type: object + additionalProperties: false + required: + - name + - email + - address + properties: + name: type: string - format: uuid - source_id: + minLength: 1 + maxLength: 200 + description: Legal or company name (a person for an individual) + contact_name: type: string - format: uuid - won_status: + minLength: 1 + maxLength: 200 + email: type: string - enum: - - PENDING - - WON - - LOST - lost_reason_id: + minLength: 3 + maxLength: 254 + format: email + description: Billing email + phone: + type: string + minLength: 1 + maxLength: 40 + description: Phone, as the customer gave it + address: + $ref: '#/components/schemas/ConversionAddress' + tax_id: + type: string + minLength: 1 + maxLength: 50 + description: VAT or tax id, when known + description: The billing details that cross into RERP + DealStatus: + type: string + enum: + - OPEN + - WON + - LOST + Pipeline: + type: object + required: + - id + - name + - currency + - created_at + description: 'A pipeline (AC: deal group): its own stages, currency, visibility and auto-assignment. Won and Lost are + statuses, not stages.' + properties: + id: type: string format: uuid - duplicate_lead_ids: + name: + type: string + maxLength: 128 + currency: + type: string + minLength: 3 + maxLength: 3 + visibility: + type: string + enum: + - ALL + - GROUPS + default: ALL + group_ids: type: array items: type: string format: uuid - duplicate_lead_count: + description: crm/teams groups that see it when visibility is GROUPS + auto_assign: + type: string + enum: + - 'OFF' + - ROUND_ROBIN + - BY_STAGE + default: 'OFF' + auto_assign_user_ids: + type: array + items: + type: string + forecast_mode: + type: string + enum: + - STAGE_PROBABILITY + - LEARNED + default: STAGE_PROBABILITY + description: LEARNED needs enough closed deals (win-probability model); until then the service reports NOT_ENOUGH_DATA + and falls back + sequence: type: integer format: int32 - create_date: - type: string - format: date-time + open_deals: + type: integer + format: int64 readOnly: true - write_date: + open_value: + type: number + format: double + readOnly: true + created_at: type: string format: date-time readOnly: true - write_uid: - type: string - format: uuid - stage_name: + updated_at: type: string + format: date-time readOnly: true - stage_probability: - type: integer - format: int32 - readOnly: true - stage_color: - type: integer - format: int32 - readOnly: true - is_rotting: - type: boolean - readOnly: true - description: A potential customer who has shown interest in our products or services - CreateLeadRequest: + PipelineRequest: type: object required: - - name + - name properties: name: type: string - maxLength: 255 - type: + currency: + type: string + visibility: type: string enum: - - LEAD - - OPPORTUNITY - default: LEAD - email_from: + - ALL + - GROUPS + group_ids: + type: array + items: + type: string + format: uuid + auto_assign: type: string - format: email - email: + enum: + - 'OFF' + - ROUND_ROBIN + - BY_STAGE + auto_assign_user_ids: + type: array + items: + type: string + forecast_mode: type: string - format: email - phone: + enum: + - STAGE_PROBABILITY + - LEARNED + sequence: + type: integer + format: int32 + clone_stages_from: type: string - mobile: + format: uuid + description: Copy another pipeline's stages on create + DealContact: + type: object + required: + - contact_id + properties: + contact_id: type: string - title: + format: uuid + name: type: string - enum: - - MR - - MRS - - MME - function: + readOnly: true + email: type: string - contact_name: + readOnly: true + role_id: type: string - company_name: + format: uuid + role: type: string - website: + readOnly: true + primary: + type: boolean + default: false + Deal: + type: object + required: + - id + - title + - pipeline_id + - stage_id + - status + - value + - currency + - created_at + properties: + id: type: string - format: uri + format: uuid + title: + type: string + maxLength: 255 description: type: string - referred_by: + pipeline_id: type: string - priority: + format: uuid + pipeline_name: type: string - enum: - - LOW - - NORMAL - - HIGH - - URGENT + readOnly: true stage_id: type: string format: uuid - tag_ids: - type: array - items: - type: string - format: uuid - expected_revenue: + stage_name: + type: string + readOnly: true + stage_entered_at: + type: string + format: date-time + readOnly: true + days_in_stage: + type: integer + format: int32 + readOnly: true + status: + $ref: '#/components/schemas/DealStatus' + status_changed_at: + type: string + format: date-time + readOnly: true + lost_reason: + type: string + value: type: number format: double + currency: + type: string probability: + type: integer + format: int32 + description: Stage probability, or the learned win probability when the pipeline uses LEARNED + readOnly: true + weighted_value: type: number - format: float - minimum: 0 - maximum: 100 - user_id: - type: string - format: uuid - team_id: + format: double + readOnly: true + owner_id: type: string - format: uuid - partner_id: + owner_name: type: string - format: uuid + readOnly: true company_id: type: string format: uuid - campaign_id: + description: crm/contacts company (marketing-side), not the converted crm/accounts record + company_name: type: string - format: uuid - medium_id: + readOnly: true + contacts: + type: array + items: + $ref: '#/components/schemas/DealContact' + primary_contact_id: type: string format: uuid - source_id: + readOnly: true + source: type: string - format: uuid - date_deadline: + description: form:, automation:, import, manual, referral ... + expected_close_at: type: string format: date - recurring_plan_id: - type: string - format: uuid - recurring_revenue: - type: number - format: double - description: Request body for creating a new lead - UpdateLeadRequest: - type: object - properties: - name: - type: string - type: + next_task_at: type: string - enum: - - LEAD - - OPPORTUNITY - email_from: + format: date-time + readOnly: true + open_task_count: + type: integer + format: int32 + readOnly: true + last_activity_at: type: string - email: + format: date-time + readOnly: true + custom_fields: + type: object + additionalProperties: true + description: crm/platform custom fields with entity deal + tag_ids: + type: array + items: + type: string + format: uuid + created_by: type: string - format: email - phone: + readOnly: true + created_at: type: string - mobile: + format: date-time + readOnly: true + updated_at: type: string + format: date-time + readOnly: true + CreateDealRequest: + type: object + required: + - title + - pipeline_id + properties: title: type: string - enum: - - MR - - MRS - - MME - function: + description: type: string - contact_name: + pipeline_id: type: string - company_name: + format: uuid + stage_id: type: string - website: + format: uuid + description: Defaults to the pipeline's first stage + value: + type: number + format: double + currency: type: string - format: uri - description: + owner_id: type: string - referred_by: + description: 'Absent: the pipeline''s auto-assignment, else the caller' + company_id: type: string - priority: + format: uuid + contacts: + type: array + items: + $ref: '#/components/schemas/DealContact' + source: type: string - enum: - - LOW - - NORMAL - - HIGH - - URGENT - active: - type: boolean - stage_id: + expected_close_at: type: string - format: uuid + format: date + custom_fields: + type: object tag_ids: type: array items: type: string format: uuid - expected_revenue: + UpdateDealRequest: + type: object + properties: + title: + type: string + description: + type: string + value: type: number format: double - probability: - type: number - format: float - user_id: - type: string - format: uuid - team_id: + currency: type: string - format: uuid - partner_id: + owner_id: type: string - format: uuid company_id: type: string format: uuid - campaign_id: + expected_close_at: type: string - format: uuid - medium_id: + format: date + custom_fields: + type: object + tag_ids: + type: array + items: + type: string + format: uuid + DealStageChangeRequest: + type: object + required: + - stage_id + properties: + stage_id: type: string format: uuid - source_id: + pipeline_id: type: string format: uuid - date_deadline: + description: Move to another pipeline (the stage must belong to it) + comment: type: string - format: date - lost_reason_id: + DealStatusChangeRequest: + type: object + required: + - status + properties: + status: + $ref: '#/components/schemas/DealStatus' + lost_reason: type: string - format: uuid - # Update bodies are partial by design: only the fields being changed are - # sent. The original spec required every field, which forced clients to - # echo the whole lead on every update. - description: Request body for updating an existing lead (all fields optional; send only what changes) - Stage: + won_value: + type: number + format: double + convert_to_customer: + type: boolean + default: true + description: 'WON: emit the signed conversion to crm/accounts (RERP ADR 003)' + DealRole: type: object required: - - id - - name - - sequence - - probability + - id + - title properties: id: type: string format: uuid - name: - type: string - maxLength: 128 - sequence: - type: integer - format: int32 - minimum: 1 - description: Order in pipeline - probability: - type: integer - format: int32 - minimum: 0 - maximum: 100 - description: Win probability for this stage - is_won: - type: boolean - description: Marks final Won stage - is_lost: - type: boolean - description: Marks a Lost stage - rotting_threshold_days: - type: integer - format: int32 - minimum: 1 - description: Days before stage shows as stale - requirements: + title: type: string - description: Internal requirements/tooltip - team_ids: - type: array - items: - type: string - format: uuid - fold: - type: boolean - description: Folded in Kanban when no deals - color: - type: integer - format: int32 - minimum: 1 - maximum: 16 + maxLength: 64 description: type: string - lead_count: + used_on: type: integer - format: int32 + format: int64 readOnly: true - description: A pipeline stage representing a step in the sales process - CreateStageRequest: + DealRoleRequest: type: object required: - - name - - sequence - - probability + - title properties: - name: - type: string - maxLength: 128 - sequence: - type: integer - format: int32 - minimum: 1 - probability: - type: integer - format: int32 - minimum: 0 - maximum: 100 - is_won: - type: boolean - is_lost: - type: boolean - rotting_threshold_days: - type: integer - format: int32 - minimum: 1 - requirements: + title: type: string - team_ids: - type: array - items: - type: string - format: uuid - fold: - type: boolean - color: - type: integer - format: int32 - minimum: 1 - maximum: 16 description: type: string - description: Request body for creating a new pipeline stage - UpdateStageRequest: + Note: type: object + required: + - id + - text + - created_at properties: - name: + id: type: string - sequence: - type: integer - format: int32 - probability: - type: integer - format: int32 - is_won: - type: boolean - is_lost: - type: boolean - rotting_threshold_days: - type: integer - format: int32 - requirements: + format: uuid + text: type: string - team_ids: - type: array - items: - type: string - format: uuid - fold: + maxLength: 10000 + author: + type: string + readOnly: true + description: A staff user id, or WORKFLOW + pinned: type: boolean - color: - type: integer - format: int32 - description: + default: false + created_at: type: string + format: date-time + readOnly: true + updated_at: + type: string + format: date-time + readOnly: true + NoteRequest: + type: object required: - - name - - sequence - - probability - - is_won - - is_lost - - rotting_threshold_days - - requirements - - team_ids - - fold - - color - - description - description: Request body for updating an existing stage - StageChangeRequest: + - text + properties: + text: + type: string + pinned: + type: boolean + Attachment: type: object required: - - stage_id + - id + - filename + - size + - created_at properties: - stage_id: + id: type: string format: uuid - lost_reason_id: + filename: + type: string + content_type: + type: string + size: + type: integer + format: int64 + url: + type: string + format: uri + readOnly: true + description: Signed, time-limited + uploaded_by: + type: string + readOnly: true + created_at: + type: string + format: date-time + readOnly: true + ActivityEntry: + type: object + required: + - id + - kind + - at + description: One line of a deal's timeline + properties: + id: type: string format: uuid - description: Required when transitioning to a lost stage - comment: + kind: type: string - description: Optional comment on stage change - description: Request body for transitioning a lead to a new stage - ConvertLeadRequest: + enum: + - CREATED + - STAGE_CHANGED + - STATUS_CHANGED + - VALUE_CHANGED + - OWNER_CHANGED + - FIELD_CHANGED + - CONTACT_ADDED + - CONTACT_REMOVED + - NOTE_ADDED + - FILE_ADDED + - TASK_ADDED + - TASK_COMPLETED + - EMAIL_SENT + - EMAIL_RECEIVED + - WORKFLOW_ACTION + summary: + type: string + actor: + type: string + description: A staff user id, WORKFLOW, FORM, IMPORT or CONTACT + detail: + type: object + at: + type: string + format: date-time + DealEmail: type: object - additionalProperties: false required: - - reason - - reference - - customer + - id + - direction + - subject + - at + description: A 1:1 email on a deal, sent through a connected mailbox (crm/platform) or received by it properties: - reason: + id: + type: string + format: uuid + direction: type: string enum: - - order - - contract - description: An accepted quote or order, or a signed contract. Paid Stripe checkouts convert automatically. - reference: + - OUT + - IN + mailbox_id: type: string - minLength: 1 - maxLength: 200 - description: The order, quote or contract reference - customer: - $ref: '#/components/schemas/ConversionCustomer' - description: Request body for converting a lead (ADR 003) - ConversionResult: + format: uuid + from: + type: string + to: + type: array + items: + type: string + subject: + type: string + snippet: + type: string + body_html: + type: string + contact_id: + type: string + format: uuid + saved_response_id: + type: string + format: uuid + opened_at: + type: string + format: date-time + readOnly: true + clicked_at: + type: string + format: date-time + readOnly: true + replied_at: + type: string + format: date-time + readOnly: true + thread_id: + type: string + at: + type: string + format: date-time + SendDealEmailRequest: type: object required: - - lead_id - - conversion_id - - reason - - stage + - to + - subject + - body_html properties: - lead_id: - type: string - format: uuid - conversion_id: + mailbox_id: type: string format: uuid - description: 'Deterministic per lead: a retry is the same conversion' - reason: + description: Defaults to the caller's connected mailbox + to: + type: array + items: + type: string + cc: + type: array + items: + type: string + subject: type: string - enum: - - order - - contract - stage: + body_html: type: string - description: The lead stage after conversion (converted) - message_id: + saved_response_id: type: string - description: The Pub/Sub message id of the published conversion - description: A published conversion - DuplicateDetectionRequest: + format: uuid + track_opens: + type: boolean + default: true + track_clicks: + type: boolean + default: true + attachment_ids: + type: array + items: + type: string + format: uuid + DealSettings: type: object properties: - email: + default_currency: type: string - format: email - phone: + require_expected_close_from_stage_id: type: string - name: + format: uuid + default_pipeline_id: type: string - required: - - email - - phone - - name - description: Request body for checking lead duplicates by email/phone/name - DuplicateDetectionResult: + format: uuid + win_probability: + type: object + readOnly: true + additionalProperties: + type: object + properties: + status: + type: string + enum: + - READY + - NOT_ENOUGH_DATA + - 'OFF' + closed_deals: + type: integer + required: + type: integer + description: 'Per pipeline id: whether the learned model can be used' + PipelineSummary: type: object properties: - duplicates: + pipeline_id: + type: string + format: uuid + open: + type: integer + format: int64 + open_value: + type: number + format: double + weighted_value: + type: number + format: double + won_this_month: + type: integer + won_value_this_month: + type: number + format: double + stalled: + type: integer + stalled_value: + type: number + format: double + stages: type: array items: - type: string - format: uuid - required: - - duplicates - description: Result of duplicate detection with matched records - MergeLeadsRequest: + type: object + properties: + stage_id: + type: string + format: uuid + stage_name: + type: string + count: + type: integer + revenue: + type: number + format: double + weighted_revenue: + type: number + format: double + probability: + type: integer + BulkDealRequest: type: object required: - - keep_id - - merge_id + - deal_ids + - action properties: - keep_id: + deal_ids: + type: array + items: + type: string + format: uuid + action: type: string - format: uuid - merge_id: + enum: + - MOVE_STAGE + - ASSIGN_OWNER + - SET_STATUS + - ADD_TAG + - REMOVE_TAG + - DELETE + stage_id: type: string format: uuid - description: Request body for merging duplicate leads - MergeResult: - type: object - properties: - kept_id: + pipeline_id: type: string format: uuid - merged_id: + owner_id: + type: string + status: + $ref: '#/components/schemas/DealStatus' + tag_id: type: string format: uuid - merged_tag_count: + PaginatedPipeline: + type: object + required: + - items + - total + - page + - limit + properties: + items: + type: array + items: + $ref: '#/components/schemas/Pipeline' + total: + type: integer + format: int64 + page: type: integer format: int32 - merged_description_additions: + limit: type: integer format: int32 - required: - - kept_id - - merged_id - - merged_tag_count - - merged_description_additions - description: Result of merging multiple records together - PaginatedResponse: + PaginatedDeal: type: object required: - - total - - page - - limit + - items + - total + - page + - limit properties: + items: + type: array + items: + $ref: '#/components/schemas/Deal' total: type: integer format: int64 @@ -1558,40 +4086,39 @@ components: limit: type: integer format: int32 - description: A generic paginated response wrapper with items and pagination metadata - ErrorResponse: + PaginatedDealRole: type: object required: - - code - - message + - items + - total + - page + - limit properties: - code: + items: + type: array + items: + $ref: '#/components/schemas/DealRole' + total: + type: integer + format: int64 + page: type: integer format: int32 - description: HTTP error code - message: - type: string - description: Human-readable error message - details: - type: string - description: Additional error details - description: An error response with code, message, and optional details - # NOTE: BRRTRouter's generator does not flatten allOf into typed response - # structs (it produced an empty Response for list_leads/list_stages), so the - # paginated wrappers are declared inline rather than composed from - # PaginatedResponse. Keep them inline until the generator supports allOf. - PaginatedLead: + limit: + type: integer + format: int32 + PaginatedNote: type: object required: - - items - - total - - page - - limit + - items + - total + - page + - limit properties: items: type: array items: - $ref: '#/components/schemas/Lead' + $ref: '#/components/schemas/Note' total: type: integer format: int64 @@ -1601,19 +4128,18 @@ components: limit: type: integer format: int32 - description: Paginated list of Lead records - PaginatedStage: + PaginatedAttachment: type: object required: - - items - - total - - page - - limit + - items + - total + - page + - limit properties: items: type: array items: - $ref: '#/components/schemas/Stage' + $ref: '#/components/schemas/Attachment' total: type: integer format: int64 @@ -1623,116 +4149,48 @@ components: limit: type: integer format: int32 - description: Paginated list of Stage records - PaginatedPipelineSummary: + PaginatedActivityEntry: type: object required: - - total_opportunities - - total_revenue - - total_weighted_revenue - - stages + - items + - total + - page + - limit properties: - total_opportunities: - type: integer - format: int32 - total_revenue: - type: number - format: double - total_weighted_revenue: - type: number - format: double - stages: + items: type: array items: - type: object - properties: - stage_id: - type: string - format: uuid - stage_name: - type: string - count: - type: integer - format: int32 - total_revenue: - type: number - format: double - weighted_revenue: - type: number - format: double - avg_days_in_stage: - type: number - format: float - description: Paginated list of PipelineSummary records - ConversionAddress: - type: object - additionalProperties: false - required: - - line1 - - city - - country - properties: - line1: - type: string - minLength: 1 - maxLength: 200 - line2: - type: string - minLength: 1 - maxLength: 200 - city: - type: string - minLength: 1 - maxLength: 100 - postal_code: - type: string - minLength: 1 - maxLength: 20 - region: - type: string - minLength: 1 - maxLength: 100 - country: - type: string - pattern: ^[A-Z]{2}$ - description: ISO 3166-1 alpha-2 - description: Billing address - ConversionCustomer: + $ref: '#/components/schemas/ActivityEntry' + total: + type: integer + format: int64 + page: + type: integer + format: int32 + limit: + type: integer + format: int32 + PaginatedDealEmail: type: object - additionalProperties: false required: - - name - - email - - address + - items + - total + - page + - limit properties: - name: - type: string - minLength: 1 - maxLength: 200 - description: Legal or company name (a person for an individual) - contact_name: - type: string - minLength: 1 - maxLength: 200 - email: - type: string - minLength: 3 - maxLength: 254 - format: email - description: Billing email - phone: - type: string - minLength: 1 - maxLength: 40 - description: Phone, as the customer gave it - address: - $ref: '#/components/schemas/ConversionAddress' - tax_id: - type: string - minLength: 1 - maxLength: 50 - description: VAT or tax id, when known - description: The billing details that cross into RERP + items: + type: array + items: + $ref: '#/components/schemas/DealEmail' + total: + type: integer + format: int64 + page: + type: integer + format: int32 + limit: + type: integer + format: int32 parameters: Id: name: id diff --git a/microservices/crm/pipeline/gen/src/controllers/add_deal_contact.rs b/microservices/crm/pipeline/gen/src/controllers/add_deal_contact.rs new file mode 100644 index 00000000..f4874901 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/add_deal_contact.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'add_deal_contact'. + +use crate::handlers::add_deal_contact::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(AddDealContactController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/add_deal_note.rs b/microservices/crm/pipeline/gen/src/controllers/add_deal_note.rs new file mode 100644 index 00000000..38e0de00 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/add_deal_note.rs @@ -0,0 +1,18 @@ +// User-owned controller for handler 'add_deal_note'. + +use crate::handlers::add_deal_note::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(AddDealNoteController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + author: Some("example".to_string()), + created_at: "example".to_string(), + id: "example".to_string(), + pinned: Some(true), + text: "example".to_string(), + updated_at: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/bulk_update_deals.rs b/microservices/crm/pipeline/gen/src/controllers/bulk_update_deals.rs new file mode 100644 index 00000000..d10340ca --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/bulk_update_deals.rs @@ -0,0 +1,14 @@ +// User-owned controller for handler 'bulk_update_deals'. + +use crate::handlers::bulk_update_deals::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(BulkUpdateDealsController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + skipped: Some(vec![]), + updated: Some(42), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/change_deal_stage.rs b/microservices/crm/pipeline/gen/src/controllers/change_deal_stage.rs new file mode 100644 index 00000000..acd8ef34 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/change_deal_stage.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'change_deal_stage'. + +use crate::handlers::change_deal_stage::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(ChangeDealStageController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/change_deal_status.rs b/microservices/crm/pipeline/gen/src/controllers/change_deal_status.rs new file mode 100644 index 00000000..42715e66 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/change_deal_status.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'change_deal_status'. + +use crate::handlers::change_deal_status::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(ChangeDealStatusController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/create_deal.rs b/microservices/crm/pipeline/gen/src/controllers/create_deal.rs new file mode 100644 index 00000000..8ce11985 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/create_deal.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'create_deal'. + +use crate::handlers::create_deal::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(CreateDealController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/create_deal_role.rs b/microservices/crm/pipeline/gen/src/controllers/create_deal_role.rs new file mode 100644 index 00000000..4aa55d57 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/create_deal_role.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'create_deal_role'. + +use crate::handlers::create_deal_role::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(CreateDealRoleController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + description: Some("example".to_string()), + id: "example".to_string(), + title: "example".to_string(), + used_on: Some(42), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/create_pipeline.rs b/microservices/crm/pipeline/gen/src/controllers/create_pipeline.rs new file mode 100644 index 00000000..b18ddfeb --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/create_pipeline.rs @@ -0,0 +1,25 @@ +// User-owned controller for handler 'create_pipeline'. + +use crate::handlers::create_pipeline::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(CreatePipelineController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + auto_assign: Some("example".to_string()), + auto_assign_user_ids: Some(vec![]), + created_at: "example".to_string(), + currency: "example".to_string(), + forecast_mode: Some("example".to_string()), + group_ids: Some(vec![]), + id: "example".to_string(), + name: "example".to_string(), + open_deals: Some(42), + open_value: Some(1.5), + sequence: Some(42), + updated_at: Some("example".to_string()), + visibility: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/create_stage.rs b/microservices/crm/pipeline/gen/src/controllers/create_stage.rs index 02d979cc..381737c8 100644 --- a/microservices/crm/pipeline/gen/src/controllers/create_stage.rs +++ b/microservices/crm/pipeline/gen/src/controllers/create_stage.rs @@ -8,7 +8,9 @@ use brrtrouter_macros::handler; #[handler(CreateStageController)] pub fn handle(_req: TypedHandlerRequest) -> HttpJson { HttpJson::ok(Response { - color: Some(42), + card_fields: Some(vec![]), + color: Some("example".to_string()), + deal_order: Some("example".to_string()), description: Some("example".to_string()), fold: Some(true), id: "example".to_string(), @@ -16,8 +18,10 @@ pub fn handle(_req: TypedHandlerRequest) -> HttpJson { is_won: Some(true), lead_count: Some(42), name: "example".to_string(), + pipeline_id: Some("example".to_string()), probability: 42, requirements: Some("example".to_string()), + rotting_days: Some(42), rotting_threshold_days: Some(42), sequence: 42, team_ids: Some(vec![]), diff --git a/microservices/crm/pipeline/gen/src/controllers/delete_deal.rs b/microservices/crm/pipeline/gen/src/controllers/delete_deal.rs new file mode 100644 index 00000000..6dcaeef4 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/delete_deal.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'delete_deal'. + +use crate::handlers::delete_deal::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(DeleteDealController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/delete_deal_file.rs b/microservices/crm/pipeline/gen/src/controllers/delete_deal_file.rs new file mode 100644 index 00000000..b7822efc --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/delete_deal_file.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'delete_deal_file'. + +use crate::handlers::delete_deal_file::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(DeleteDealFileController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/delete_deal_note.rs b/microservices/crm/pipeline/gen/src/controllers/delete_deal_note.rs new file mode 100644 index 00000000..2b8e83ab --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/delete_deal_note.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'delete_deal_note'. + +use crate::handlers::delete_deal_note::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(DeleteDealNoteController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/delete_deal_role.rs b/microservices/crm/pipeline/gen/src/controllers/delete_deal_role.rs new file mode 100644 index 00000000..1724f559 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/delete_deal_role.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'delete_deal_role'. + +use crate::handlers::delete_deal_role::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(DeleteDealRoleController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/delete_pipeline.rs b/microservices/crm/pipeline/gen/src/controllers/delete_pipeline.rs new file mode 100644 index 00000000..5fcb8891 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/delete_pipeline.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'delete_pipeline'. + +use crate::handlers::delete_pipeline::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(DeletePipelineController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_deal.rs b/microservices/crm/pipeline/gen/src/controllers/get_deal.rs new file mode 100644 index 00000000..2d6009ce --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/get_deal.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'get_deal'. + +use crate::handlers::get_deal::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(GetDealController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_deal_role.rs b/microservices/crm/pipeline/gen/src/controllers/get_deal_role.rs new file mode 100644 index 00000000..cba6e6a5 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/get_deal_role.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'get_deal_role'. + +use crate::handlers::get_deal_role::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(GetDealRoleController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + description: Some("example".to_string()), + id: "example".to_string(), + title: "example".to_string(), + used_on: Some(42), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_deal_settings.rs b/microservices/crm/pipeline/gen/src/controllers/get_deal_settings.rs new file mode 100644 index 00000000..f0e6b815 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/get_deal_settings.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'get_deal_settings'. + +use crate::handlers::get_deal_settings::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(GetDealSettingsController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + default_currency: Some("example".to_string()), + default_pipeline_id: Some("example".to_string()), + require_expected_close_from_stage_id: Some("example".to_string()), + win_probability: Some(Default::default()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_pipeline.rs b/microservices/crm/pipeline/gen/src/controllers/get_pipeline.rs new file mode 100644 index 00000000..e8965a20 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/get_pipeline.rs @@ -0,0 +1,25 @@ +// User-owned controller for handler 'get_pipeline'. + +use crate::handlers::get_pipeline::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(GetPipelineController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + auto_assign: Some("example".to_string()), + auto_assign_user_ids: Some(vec![]), + created_at: "example".to_string(), + currency: "example".to_string(), + forecast_mode: Some("example".to_string()), + group_ids: Some(vec![]), + id: "example".to_string(), + name: "example".to_string(), + open_deals: Some(42), + open_value: Some(1.5), + sequence: Some(42), + updated_at: Some("example".to_string()), + visibility: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_pipeline_summary.rs b/microservices/crm/pipeline/gen/src/controllers/get_pipeline_summary.rs new file mode 100644 index 00000000..90771b08 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/get_pipeline_summary.rs @@ -0,0 +1,21 @@ +// User-owned controller for handler 'get_pipeline_summary'. + +use crate::handlers::get_pipeline_summary::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(GetPipelineSummaryController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + open: Some(42), + open_value: Some(1.5), + pipeline_id: Some("example".to_string()), + stages: Some(vec![]), + stalled: Some(42), + stalled_value: Some(1.5), + weighted_value: Some(1.5), + won_this_month: Some(42), + won_value_this_month: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/get_stage.rs b/microservices/crm/pipeline/gen/src/controllers/get_stage.rs index 116ee22a..c659b0f1 100644 --- a/microservices/crm/pipeline/gen/src/controllers/get_stage.rs +++ b/microservices/crm/pipeline/gen/src/controllers/get_stage.rs @@ -7,7 +7,9 @@ use brrtrouter_macros::handler; #[handler(GetStageController)] pub fn handle(_req: TypedHandlerRequest) -> Response { Response { - color: Some(42), + card_fields: Some(vec![]), + color: Some("example".to_string()), + deal_order: Some("example".to_string()), description: Some("example".to_string()), fold: Some(true), id: "example".to_string(), @@ -15,8 +17,10 @@ pub fn handle(_req: TypedHandlerRequest) -> Response { is_won: Some(true), lead_count: Some(42), name: "example".to_string(), + pipeline_id: Some("example".to_string()), probability: 42, requirements: Some("example".to_string()), + rotting_days: Some(42), rotting_threshold_days: Some(42), sequence: 42, team_ids: Some(vec![]), diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deal_activity.rs b/microservices/crm/pipeline/gen/src/controllers/list_deal_activity.rs new file mode 100644 index 00000000..758831eb --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deal_activity.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deal_activity'. + +use crate::handlers::list_deal_activity::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::ActivityEntry; + +#[handler(ListDealActivityController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deal_emails.rs b/microservices/crm/pipeline/gen/src/controllers/list_deal_emails.rs new file mode 100644 index 00000000..d993b216 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deal_emails.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deal_emails'. + +use crate::handlers::list_deal_emails::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealEmail; + +#[handler(ListDealEmailsController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deal_files.rs b/microservices/crm/pipeline/gen/src/controllers/list_deal_files.rs new file mode 100644 index 00000000..23c5dbb7 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deal_files.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deal_files'. + +use crate::handlers::list_deal_files::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::Attachment; + +#[handler(ListDealFilesController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deal_notes.rs b/microservices/crm/pipeline/gen/src/controllers/list_deal_notes.rs new file mode 100644 index 00000000..05f19302 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deal_notes.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deal_notes'. + +use crate::handlers::list_deal_notes::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::Note; + +#[handler(ListDealNotesController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deal_roles.rs b/microservices/crm/pipeline/gen/src/controllers/list_deal_roles.rs new file mode 100644 index 00000000..1e9880d3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deal_roles.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deal_roles'. + +use crate::handlers::list_deal_roles::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealRole; + +#[handler(ListDealRolesController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_deals.rs b/microservices/crm/pipeline/gen/src/controllers/list_deals.rs new file mode 100644 index 00000000..4ce18eed --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_deals.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_deals'. + +use crate::handlers::list_deals::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::Deal; + +#[handler(ListDealsController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/list_pipelines.rs b/microservices/crm/pipeline/gen/src/controllers/list_pipelines.rs new file mode 100644 index 00000000..438c1a5d --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/list_pipelines.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'list_pipelines'. + +use crate::handlers::list_pipelines::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::Pipeline; + +#[handler(ListPipelinesController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + items: vec![], + limit: 42, + page: 42, + total: 42, + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/mod.rs b/microservices/crm/pipeline/gen/src/controllers/mod.rs index c3a680ae..395f9214 100644 --- a/microservices/crm/pipeline/gen/src/controllers/mod.rs +++ b/microservices/crm/pipeline/gen/src/controllers/mod.rs @@ -3,6 +3,62 @@ // ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate // ⚠️ To implement business logic, edit the corresponding controller file +pub mod list_deal_roles; + +pub mod create_deal_role; + +pub mod get_deal_role; + +pub mod update_deal_role; + +pub mod delete_deal_role; + +pub mod patch_deal_role; + +pub mod list_deals; + +pub mod create_deal; + +pub mod bulk_update_deals; + +pub mod get_deal; + +pub mod update_deal; + +pub mod delete_deal; + +pub mod patch_deal; + +pub mod list_deal_activity; + +pub mod add_deal_contact; + +pub mod remove_deal_contact; + +pub mod update_deal_contact; + +pub mod list_deal_emails; + +pub mod send_deal_email; + +pub mod list_deal_files; + +pub mod upload_deal_file; + +pub mod delete_deal_file; + +pub mod list_deal_notes; + +pub mod add_deal_note; + +pub mod delete_deal_note; + +pub mod update_deal_note; + +pub mod change_deal_stage; + +pub mod change_deal_status; + pub mod list_leads; pub mod create_lead; @@ -23,6 +79,24 @@ pub mod change_stage; pub mod pipeline_summary; +pub mod list_pipelines; + +pub mod create_pipeline; + +pub mod get_pipeline; + +pub mod update_pipeline; + +pub mod delete_pipeline; + +pub mod patch_pipeline; + +pub mod get_pipeline_summary; + +pub mod get_deal_settings; + +pub mod update_deal_settings; + pub mod list_stages; pub mod create_stage; diff --git a/microservices/crm/pipeline/gen/src/controllers/patch_deal.rs b/microservices/crm/pipeline/gen/src/controllers/patch_deal.rs new file mode 100644 index 00000000..db24a957 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/patch_deal.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'patch_deal'. + +use crate::handlers::patch_deal::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(PatchDealController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/patch_deal_role.rs b/microservices/crm/pipeline/gen/src/controllers/patch_deal_role.rs new file mode 100644 index 00000000..9c0d3600 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/patch_deal_role.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'patch_deal_role'. + +use crate::handlers::patch_deal_role::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(PatchDealRoleController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + description: Some("example".to_string()), + id: "example".to_string(), + title: "example".to_string(), + used_on: Some(42), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/patch_pipeline.rs b/microservices/crm/pipeline/gen/src/controllers/patch_pipeline.rs new file mode 100644 index 00000000..c478c7a7 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/patch_pipeline.rs @@ -0,0 +1,25 @@ +// User-owned controller for handler 'patch_pipeline'. + +use crate::handlers::patch_pipeline::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(PatchPipelineController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + auto_assign: Some("example".to_string()), + auto_assign_user_ids: Some(vec![]), + created_at: "example".to_string(), + currency: "example".to_string(), + forecast_mode: Some("example".to_string()), + group_ids: Some(vec![]), + id: "example".to_string(), + name: "example".to_string(), + open_deals: Some(42), + open_value: Some(1.5), + sequence: Some(42), + updated_at: Some("example".to_string()), + visibility: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/remove_deal_contact.rs b/microservices/crm/pipeline/gen/src/controllers/remove_deal_contact.rs new file mode 100644 index 00000000..514016ba --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/remove_deal_contact.rs @@ -0,0 +1,11 @@ +// User-owned controller for handler 'remove_deal_contact'. + +use crate::handlers::remove_deal_contact::Request; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(RemoveDealContactController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpNoContent { + HttpNoContent +} diff --git a/microservices/crm/pipeline/gen/src/controllers/send_deal_email.rs b/microservices/crm/pipeline/gen/src/controllers/send_deal_email.rs new file mode 100644 index 00000000..65329b27 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/send_deal_email.rs @@ -0,0 +1,27 @@ +// User-owned controller for handler 'send_deal_email'. + +use crate::handlers::send_deal_email::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(SendDealEmailController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + at: "example".to_string(), + body_html: Some("example".to_string()), + clicked_at: Some("example".to_string()), + contact_id: Some("example".to_string()), + direction: "example".to_string(), + from: Some("example".to_string()), + id: "example".to_string(), + mailbox_id: Some("example".to_string()), + opened_at: Some("example".to_string()), + replied_at: Some("example".to_string()), + saved_response_id: Some("example".to_string()), + snippet: Some("example".to_string()), + subject: "example".to_string(), + thread_id: Some("example".to_string()), + to: Some(vec![]), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_deal.rs b/microservices/crm/pipeline/gen/src/controllers/update_deal.rs new file mode 100644 index 00000000..3d9382b4 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_deal.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'update_deal'. + +use crate::handlers::update_deal::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(UpdateDealController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_deal_contact.rs b/microservices/crm/pipeline/gen/src/controllers/update_deal_contact.rs new file mode 100644 index 00000000..73dd5727 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_deal_contact.rs @@ -0,0 +1,49 @@ +// User-owned controller for handler 'update_deal_contact'. + +use crate::handlers::update_deal_contact::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[allow(unused_imports)] +use crate::handlers::types::DealContact; +#[allow(unused_imports)] +use crate::handlers::types::DealStatus; + +#[handler(UpdateDealContactController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + company_id: Some("example".to_string()), + company_name: Some("example".to_string()), + contacts: Some(vec![]), + created_at: "example".to_string(), + created_by: Some("example".to_string()), + currency: "example".to_string(), + custom_fields: Some(Default::default()), + days_in_stage: Some(42), + description: Some("example".to_string()), + expected_close_at: Some("example".to_string()), + id: "example".to_string(), + last_activity_at: Some("example".to_string()), + lost_reason: Some("example".to_string()), + next_task_at: Some("example".to_string()), + open_task_count: Some(42), + owner_id: Some("example".to_string()), + owner_name: Some("example".to_string()), + pipeline_id: "example".to_string(), + pipeline_name: Some("example".to_string()), + primary_contact_id: Some("example".to_string()), + probability: Some(42), + source: Some("example".to_string()), + stage_entered_at: Some("example".to_string()), + stage_id: "example".to_string(), + stage_name: Some("example".to_string()), + status: Default::default(), + status_changed_at: Some("example".to_string()), + tag_ids: Some(vec![]), + title: "example".to_string(), + updated_at: Some("example".to_string()), + value: 1.5, + weighted_value: Some(1.5), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_deal_note.rs b/microservices/crm/pipeline/gen/src/controllers/update_deal_note.rs new file mode 100644 index 00000000..98d38b8c --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_deal_note.rs @@ -0,0 +1,18 @@ +// User-owned controller for handler 'update_deal_note'. + +use crate::handlers::update_deal_note::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(UpdateDealNoteController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + author: Some("example".to_string()), + created_at: "example".to_string(), + id: "example".to_string(), + pinned: Some(true), + text: "example".to_string(), + updated_at: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_deal_role.rs b/microservices/crm/pipeline/gen/src/controllers/update_deal_role.rs new file mode 100644 index 00000000..e2cdbb42 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_deal_role.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'update_deal_role'. + +use crate::handlers::update_deal_role::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(UpdateDealRoleController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + description: Some("example".to_string()), + id: "example".to_string(), + title: "example".to_string(), + used_on: Some(42), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_deal_settings.rs b/microservices/crm/pipeline/gen/src/controllers/update_deal_settings.rs new file mode 100644 index 00000000..5be37020 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_deal_settings.rs @@ -0,0 +1,16 @@ +// User-owned controller for handler 'update_deal_settings'. + +use crate::handlers::update_deal_settings::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(UpdateDealSettingsController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + default_currency: Some("example".to_string()), + default_pipeline_id: Some("example".to_string()), + require_expected_close_from_stage_id: Some("example".to_string()), + win_probability: Some(Default::default()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_pipeline.rs b/microservices/crm/pipeline/gen/src/controllers/update_pipeline.rs new file mode 100644 index 00000000..e61204b4 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/update_pipeline.rs @@ -0,0 +1,25 @@ +// User-owned controller for handler 'update_pipeline'. + +use crate::handlers::update_pipeline::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(UpdatePipelineController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + auto_assign: Some("example".to_string()), + auto_assign_user_ids: Some(vec![]), + created_at: "example".to_string(), + currency: "example".to_string(), + forecast_mode: Some("example".to_string()), + group_ids: Some(vec![]), + id: "example".to_string(), + name: "example".to_string(), + open_deals: Some(42), + open_value: Some(1.5), + sequence: Some(42), + updated_at: Some("example".to_string()), + visibility: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/controllers/update_stage.rs b/microservices/crm/pipeline/gen/src/controllers/update_stage.rs index 332ad367..3154457b 100644 --- a/microservices/crm/pipeline/gen/src/controllers/update_stage.rs +++ b/microservices/crm/pipeline/gen/src/controllers/update_stage.rs @@ -8,7 +8,9 @@ use brrtrouter_macros::handler; #[handler(UpdateStageController)] pub fn handle(_req: TypedHandlerRequest) -> HttpJson { HttpJson::ok(Response { - color: Some(42), + card_fields: Some(vec![]), + color: Some("example".to_string()), + deal_order: Some("example".to_string()), description: Some("example".to_string()), fold: Some(true), id: "example".to_string(), @@ -16,8 +18,10 @@ pub fn handle(_req: TypedHandlerRequest) -> HttpJson { is_won: Some(true), lead_count: Some(42), name: "example".to_string(), + pipeline_id: Some("example".to_string()), probability: 42, requirements: Some("example".to_string()), + rotting_days: Some(42), rotting_threshold_days: Some(42), sequence: 42, team_ids: Some(vec![]), diff --git a/microservices/crm/pipeline/gen/src/controllers/upload_deal_file.rs b/microservices/crm/pipeline/gen/src/controllers/upload_deal_file.rs new file mode 100644 index 00000000..d0201601 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/controllers/upload_deal_file.rs @@ -0,0 +1,19 @@ +// User-owned controller for handler 'upload_deal_file'. + +use crate::handlers::upload_deal_file::{Request, Response}; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use brrtrouter_macros::handler; + +#[handler(UploadDealFileController)] +pub fn handle(_req: TypedHandlerRequest) -> HttpJson { + HttpJson::ok(Response { + content_type: Some("example".to_string()), + created_at: "example".to_string(), + filename: "example".to_string(), + id: "example".to_string(), + size: 42, + uploaded_by: Some("example".to_string()), + url: Some("example".to_string()), + }) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/add_deal_contact.rs b/microservices/crm/pipeline/gen/src/handlers/add_deal_contact.rs new file mode 100644 index 00000000..4e2c992e --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/add_deal_contact.rs @@ -0,0 +1,206 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "contact_id")] + pub contact_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "email")] + pub email: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "name")] + pub name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary")] + pub primary: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "role")] + pub role: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "role_id")] + pub role_id: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::add_deal_contact::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/add_deal_note.rs b/microservices/crm/pipeline/gen/src/handlers/add_deal_note.rs new file mode 100644 index 00000000..b83f920e --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/add_deal_note.rs @@ -0,0 +1,89 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pinned")] + pub pinned: Option, + + #[serde(rename = "text")] + pub text: String, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "author")] + pub author: Option, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pinned")] + pub pinned: Option, + + #[serde(rename = "text")] + pub text: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::add_deal_note::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/bulk_update_deals.rs b/microservices/crm/pipeline/gen/src/handlers/bulk_update_deals.rs new file mode 100644 index 00000000..9f334eff --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/bulk_update_deals.rs @@ -0,0 +1,81 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "action")] + pub action: String, + + #[serde(rename = "deal_ids")] + pub deal_ids: Vec, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_id")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status")] + pub status: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_id")] + pub tag_id: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "skipped")] + pub skipped: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated")] + pub updated: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::bulk_update_deals::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/change_deal_stage.rs b/microservices/crm/pipeline/gen/src/handlers/change_deal_stage.rs new file mode 100644 index 00000000..b6f6b7b8 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/change_deal_stage.rs @@ -0,0 +1,194 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "comment")] + pub comment: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::change_deal_stage::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/change_deal_status.rs b/microservices/crm/pipeline/gen/src/handlers/change_deal_status.rs new file mode 100644 index 00000000..b9c4dbe1 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/change_deal_status.rs @@ -0,0 +1,198 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "convert_to_customer")] + pub convert_to_customer: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "won_value")] + pub won_value: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::change_deal_status::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/create_deal.rs b/microservices/crm/pipeline/gen/src/handlers/create_deal.rs new file mode 100644 index 00000000..ddceec80 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/create_deal.rs @@ -0,0 +1,218 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_id")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "value")] + pub value: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::create_deal::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/create_deal_role.rs b/microservices/crm/pipeline/gen/src/handlers/create_deal_role.rs new file mode 100644 index 00000000..483f1688 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/create_deal_role.rs @@ -0,0 +1,67 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "title")] + pub title: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "used_on")] + pub used_on: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::create_deal_role::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/create_pipeline.rs b/microservices/crm/pipeline/gen/src/handlers/create_pipeline.rs new file mode 100644 index 00000000..abc8ac43 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/create_pipeline.rs @@ -0,0 +1,129 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "clone_stages_from")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_deals")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_value")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::create_pipeline::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/create_stage.rs b/microservices/crm/pipeline/gen/src/handlers/create_stage.rs index ed86ee50..def1bc62 100644 --- a/microservices/crm/pipeline/gen/src/handlers/create_stage.rs +++ b/microservices/crm/pipeline/gen/src/handlers/create_stage.rs @@ -55,9 +55,17 @@ pub struct Request { #[derive(Debug, Deserialize, Serialize)] pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "card_fields")] + pub card_fields: Option>, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "color")] - pub color: Option, + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "deal_order")] + pub deal_order: Option, #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "description")] @@ -85,6 +93,10 @@ pub struct Response { #[serde(rename = "name")] pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + #[serde(rename = "probability")] pub probability: i32, @@ -92,6 +104,10 @@ pub struct Response { #[serde(rename = "requirements")] pub requirements: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "rotting_days")] + pub rotting_days: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "rotting_threshold_days")] pub rotting_threshold_days: Option, diff --git a/microservices/crm/pipeline/gen/src/handlers/delete_deal.rs b/microservices/crm/pipeline/gen/src/handlers/delete_deal.rs new file mode 100644 index 00000000..801139a3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/delete_deal.rs @@ -0,0 +1,61 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::delete_deal::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/delete_deal_file.rs b/microservices/crm/pipeline/gen/src/handlers/delete_deal_file.rs new file mode 100644 index 00000000..3261efd3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/delete_deal_file.rs @@ -0,0 +1,76 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "file_id")] + pub file_id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_path_param("file_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "file_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'file_id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::delete_deal_file::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/delete_deal_note.rs b/microservices/crm/pipeline/gen/src/handlers/delete_deal_note.rs new file mode 100644 index 00000000..60b1f3b3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/delete_deal_note.rs @@ -0,0 +1,76 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "note_id")] + pub note_id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_path_param("note_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "note_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'note_id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::delete_deal_note::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/delete_deal_role.rs b/microservices/crm/pipeline/gen/src/handlers/delete_deal_role.rs new file mode 100644 index 00000000..de58f267 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/delete_deal_role.rs @@ -0,0 +1,61 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::delete_deal_role::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/delete_pipeline.rs b/microservices/crm/pipeline/gen/src/handlers/delete_pipeline.rs new file mode 100644 index 00000000..ca2e4a33 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/delete_pipeline.rs @@ -0,0 +1,61 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::delete_pipeline::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_deal.rs b/microservices/crm/pipeline/gen/src/handlers/get_deal.rs new file mode 100644 index 00000000..bc56ee1a --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/get_deal.rs @@ -0,0 +1,183 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::get_deal::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_deal_role.rs b/microservices/crm/pipeline/gen/src/handlers/get_deal_role.rs new file mode 100644 index 00000000..c1632ca4 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/get_deal_role.rs @@ -0,0 +1,75 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "used_on")] + pub used_on: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::get_deal_role::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_deal_settings.rs b/microservices/crm/pipeline/gen/src/handlers/get_deal_settings.rs new file mode 100644 index 00000000..8ebf5a43 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/get_deal_settings.rs @@ -0,0 +1,62 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request {} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_currency")] + pub default_currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_pipeline_id")] + pub default_pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "require_expected_close_from_stage_id")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "win_probability")] + pub win_probability: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::get_deal_settings::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_pipeline.rs b/microservices/crm/pipeline/gen/src/handlers/get_pipeline.rs new file mode 100644 index 00000000..3ec47330 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/get_pipeline.rs @@ -0,0 +1,109 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_deals")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_value")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::get_pipeline::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_pipeline_summary.rs b/microservices/crm/pipeline/gen/src/handlers/get_pipeline_summary.rs new file mode 100644 index 00000000..8afff257 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/get_pipeline_summary.rs @@ -0,0 +1,97 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open")] + pub open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_value")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stages")] + pub stages: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stalled")] + pub stalled: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stalled_value")] + pub stalled_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "won_this_month")] + pub won_this_month: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "won_value_this_month")] + pub won_value_this_month: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::get_pipeline_summary::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/get_stage.rs b/microservices/crm/pipeline/gen/src/handlers/get_stage.rs index 206f3770..9dccfc88 100644 --- a/microservices/crm/pipeline/gen/src/handlers/get_stage.rs +++ b/microservices/crm/pipeline/gen/src/handlers/get_stage.rs @@ -16,9 +16,17 @@ pub struct Request { #[derive(Debug, Deserialize, Serialize)] pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "card_fields")] + pub card_fields: Option>, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "color")] - pub color: Option, + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "deal_order")] + pub deal_order: Option, #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "description")] @@ -46,6 +54,10 @@ pub struct Response { #[serde(rename = "name")] pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + #[serde(rename = "probability")] pub probability: i32, @@ -53,6 +65,10 @@ pub struct Response { #[serde(rename = "requirements")] pub requirements: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "rotting_days")] + pub rotting_days: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "rotting_threshold_days")] pub rotting_threshold_days: Option, diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deal_activity.rs b/microservices/crm/pipeline/gen/src/handlers/list_deal_activity.rs new file mode 100644 index 00000000..5e4c13d7 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deal_activity.rs @@ -0,0 +1,144 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::ActivityEntry; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "kind")] + pub kind: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("kind") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "kind".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deal_activity::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deal_emails.rs b/microservices/crm/pipeline/gen/src/handlers/list_deal_emails.rs new file mode 100644 index 00000000..74d02aa2 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deal_emails.rs @@ -0,0 +1,127 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealEmail; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deal_emails::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deal_files.rs b/microservices/crm/pipeline/gen/src/handlers/list_deal_files.rs new file mode 100644 index 00000000..764c31f0 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deal_files.rs @@ -0,0 +1,127 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::Attachment; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deal_files::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deal_notes.rs b/microservices/crm/pipeline/gen/src/handlers/list_deal_notes.rs new file mode 100644 index 00000000..9cf55d91 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deal_notes.rs @@ -0,0 +1,127 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::Note; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deal_notes::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deal_roles.rs b/microservices/crm/pipeline/gen/src/handlers/list_deal_roles.rs new file mode 100644 index 00000000..c351ac1a --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deal_roles.rs @@ -0,0 +1,112 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealRole; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deal_roles::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_deals.rs b/microservices/crm/pipeline/gen/src/handlers/list_deals.rs new file mode 100644 index 00000000..6dd0c792 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_deals.rs @@ -0,0 +1,353 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::Deal; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_id")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status")] + pub status: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contact_id")] + pub contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_id")] + pub tag_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stalled")] + pub stalled: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_from")] + pub expected_close_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_to")] + pub expected_close_to: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "value_min")] + pub value_min: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "value_max")] + pub value_max: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sort")] + pub sort: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "dir")] + pub dir: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("pipeline_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "pipeline_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("stage_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "stage_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("status") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"enum":["OPEN","WON","LOST"],"type":"string"}), + ); + data_map.insert( + "status".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("owner_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "owner_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("contact_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "contact_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("company_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "company_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("tag_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "tag_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("stalled") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"boolean"})); + data_map.insert( + "stalled".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("expected_close_from") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"date","type":"string"})); + data_map.insert( + "expected_close_from".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("expected_close_to") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"date","type":"string"})); + data_map.insert( + "expected_close_to".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("value_min") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"number"})); + data_map.insert( + "value_min".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("value_max") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"number"})); + data_map.insert( + "value_max".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("sort") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"enum":["next_task_at","value","created_at","updated_at","expected_close_at","title"],"type":"string"}), + ); + data_map.insert( + "sort".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("dir") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"enum":["asc","desc"],"type":"string"}), + ); + data_map.insert( + "dir".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_deals::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/list_pipelines.rs b/microservices/crm/pipeline/gen/src/handlers/list_pipelines.rs new file mode 100644 index 00000000..4b05d994 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/list_pipelines.rs @@ -0,0 +1,112 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::Pipeline; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "page")] + pub page: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "limit")] + pub limit: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "search")] + pub search: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "items")] + pub items: Vec, + + #[serde(rename = "limit")] + pub limit: i32, + + #[serde(rename = "page")] + pub page: i32, + + #[serde(rename = "total")] + pub total: i64, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_query_param("page") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":1,"format":"int32","minimum":1,"type":"integer"}), + ); + data_map.insert( + "page".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("limit") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = std::sync::LazyLock::new( + || serde_json::json!({"default":50,"format":"int32","maximum":100,"minimum":1,"type":"integer"}), + ); + data_map.insert( + "limit".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(v) = req.get_query_param("search") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"type":"string"})); + data_map.insert( + "search".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + + // optional parameter + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::list_pipelines::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/mod.rs b/microservices/crm/pipeline/gen/src/handlers/mod.rs index 6ff2ed7f..22aceb0a 100644 --- a/microservices/crm/pipeline/gen/src/handlers/mod.rs +++ b/microservices/crm/pipeline/gen/src/handlers/mod.rs @@ -5,6 +5,62 @@ pub mod types; +pub mod list_deal_roles; + +pub mod create_deal_role; + +pub mod get_deal_role; + +pub mod update_deal_role; + +pub mod delete_deal_role; + +pub mod patch_deal_role; + +pub mod list_deals; + +pub mod create_deal; + +pub mod bulk_update_deals; + +pub mod get_deal; + +pub mod update_deal; + +pub mod delete_deal; + +pub mod patch_deal; + +pub mod list_deal_activity; + +pub mod add_deal_contact; + +pub mod remove_deal_contact; + +pub mod update_deal_contact; + +pub mod list_deal_emails; + +pub mod send_deal_email; + +pub mod list_deal_files; + +pub mod upload_deal_file; + +pub mod delete_deal_file; + +pub mod list_deal_notes; + +pub mod add_deal_note; + +pub mod delete_deal_note; + +pub mod update_deal_note; + +pub mod change_deal_stage; + +pub mod change_deal_status; + pub mod list_leads; pub mod create_lead; @@ -25,6 +81,24 @@ pub mod change_stage; pub mod pipeline_summary; +pub mod list_pipelines; + +pub mod create_pipeline; + +pub mod get_pipeline; + +pub mod update_pipeline; + +pub mod delete_pipeline; + +pub mod patch_pipeline; + +pub mod get_pipeline_summary; + +pub mod get_deal_settings; + +pub mod update_deal_settings; + pub mod list_stages; pub mod create_stage; diff --git a/microservices/crm/pipeline/gen/src/handlers/patch_deal.rs b/microservices/crm/pipeline/gen/src/handlers/patch_deal.rs new file mode 100644 index 00000000..28685ae3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/patch_deal.rs @@ -0,0 +1,219 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "title")] + pub title: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "value")] + pub value: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::patch_deal::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/patch_deal_role.rs b/microservices/crm/pipeline/gen/src/handlers/patch_deal_role.rs new file mode 100644 index 00000000..2806e2fc --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/patch_deal_role.rs @@ -0,0 +1,82 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "title")] + pub title: String, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "used_on")] + pub used_on: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::patch_deal_role::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/patch_pipeline.rs b/microservices/crm/pipeline/gen/src/handlers/patch_pipeline.rs new file mode 100644 index 00000000..1dde0168 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/patch_pipeline.rs @@ -0,0 +1,144 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "clone_stages_from")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_deals")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_value")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::patch_pipeline::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/remove_deal_contact.rs b/microservices/crm/pipeline/gen/src/handlers/remove_deal_contact.rs new file mode 100644 index 00000000..55e084c0 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/remove_deal_contact.rs @@ -0,0 +1,76 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpNoContent; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "contact_id")] + pub contact_id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response {} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_path_param("contact_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "contact_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'contact_id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpNoContent { + crate::controllers::remove_deal_contact::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/send_deal_email.rs b/microservices/crm/pipeline/gen/src/handlers/send_deal_email.rs new file mode 100644 index 00000000..56e03b93 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/send_deal_email.rs @@ -0,0 +1,150 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "attachment_ids")] + pub attachment_ids: Option>, + + #[serde(rename = "body_html")] + pub body_html: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "cc")] + pub cc: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "mailbox_id")] + pub mailbox_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "saved_response_id")] + pub saved_response_id: Option, + + #[serde(rename = "subject")] + pub subject: String, + + #[serde(rename = "to")] + pub to: Vec, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "track_clicks")] + pub track_clicks: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "track_opens")] + pub track_opens: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(rename = "at")] + pub at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "body_html")] + pub body_html: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "clicked_at")] + pub clicked_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contact_id")] + pub contact_id: Option, + + #[serde(rename = "direction")] + pub direction: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "from")] + pub from: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "mailbox_id")] + pub mailbox_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "opened_at")] + pub opened_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "replied_at")] + pub replied_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "saved_response_id")] + pub saved_response_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "snippet")] + pub snippet: Option, + + #[serde(rename = "subject")] + pub subject: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "thread_id")] + pub thread_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "to")] + pub to: Option>, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::send_deal_email::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/types.rs b/microservices/crm/pipeline/gen/src/handlers/types.rs index 70fe07fd..b4961559 100644 --- a/microservices/crm/pipeline/gen/src/handlers/types.rs +++ b/microservices/crm/pipeline/gen/src/handlers/types.rs @@ -5,29 +5,45 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Default)] -pub struct ChangeStageRequest { +pub struct ActivityEntry { #[serde(skip_serializing_if = "Option::is_none")] - pub comment: Option, + pub actor: Option, + + pub at: String, #[serde(skip_serializing_if = "Option::is_none")] - pub lost_reason_id: Option, + pub detail: Option, - pub stage_id: String, + pub id: String, + + pub kind: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct ChangeStageResponse { - pub active: bool, +pub struct AddDealContactRequest { + pub contact_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub automated_probability: Option, + pub email: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub campaign_id: Option, + pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, + pub primary: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub role_id: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AddDealContactResponse { #[serde(skip_serializing_if = "Option::is_none")] pub company_id: Option, @@ -35,222 +51,305 @@ pub struct ChangeStageResponse { pub company_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub contact_name: Option, + pub contacts: Option>, - pub create_date: String, + pub created_at: String, #[serde(skip_serializing_if = "Option::is_none")] - pub date_closed: Option, + pub created_by: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub date_deadline: Option, + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub date_last_stage_update: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub date_open: Option, + pub days_in_stage: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub day_close: Option, + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub day_open: Option, + pub expected_close_at: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, + pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate_lead_count: Option, + pub last_activity_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate_lead_ids: Option>, + pub lost_reason: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub email_from: Option, + pub next_task_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub email_normalized: Option, + pub open_task_count: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub expected_revenue: Option, + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub function: Option, + pub owner_name: Option, - pub id: String, + pub pipeline_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub is_automated_probability: Option, + pub pipeline_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_blacklisted: Option, + pub primary_contact_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_rotting: Option, + pub probability: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub lost_reason_id: Option, + pub source: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub medium_id: Option, + pub stage_entered_at: Option, + + pub stage_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub mobile: Option, + pub stage_name: Option, - pub name: String, + pub status: DealStatus, #[serde(skip_serializing_if = "Option::is_none")] - pub partner_id: Option, + pub status_changed_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, + pub tag_ids: Option>, + + pub title: String, #[serde(skip_serializing_if = "Option::is_none")] - pub phone_sanitized: Option, + pub updated_at: Option, + + pub value: f64, #[serde(skip_serializing_if = "Option::is_none")] - pub priority: Option, + pub weighted_value: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AddDealNoteRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub probability: Option, + pub pinned: Option, + + pub text: String, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct AddDealNoteResponse { #[serde(skip_serializing_if = "Option::is_none")] - pub prorated_revenue: Option, + pub author: Option, + + pub created_at: String, + + pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_plan_id: Option, + pub pinned: Option, + + pub text: String, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_revenue: Option, + pub updated_at: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Attachment { #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_revenue_monthly: Option, + pub content_type: Option, + + pub created_at: String, + + pub filename: String, + + pub id: String, + + pub size: i64, #[serde(skip_serializing_if = "Option::is_none")] - pub referred_by: Option, + pub uploaded_by: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub source_id: Option, + pub url: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BulkDealRequest { + pub action: String, + + pub deal_ids: Vec, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_color: Option, + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub stage_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_name: Option, + pub status: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_probability: Option, + pub tag_id: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BulkUpdateDealsRequest { + pub action: String, + + pub deal_ids: Vec, #[serde(skip_serializing_if = "Option::is_none")] - pub tag_ids: Option>, + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub team_id: Option, + pub pipeline_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, + pub stage_id: Option, - #[serde(rename = "type")] - pub r#type: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub tag_id: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct BulkUpdateDealsResponse { #[serde(skip_serializing_if = "Option::is_none")] - pub website: Option, + pub skipped: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub won_status: Option, + pub updated: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ChangeDealStageRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub write_date: Option, + pub comment: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub write_uid: Option, + pub pipeline_id: Option, + + pub stage_id: String, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct ConversionAddress { - pub city: String, +pub struct ChangeDealStageResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, - pub country: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, - pub line1: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, + + pub created_at: String, #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, + pub created_by: Option, + + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub region: Option, -} + pub days_in_stage: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct ConversionCustomer { - pub address: ConversionAddress, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub contact_name: Option, + pub expected_close_at: Option, - pub email: String, + pub id: String, - pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_activity_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, + pub lost_reason: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id: Option, -} + pub next_task_at: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct ConversionResult { - pub conversion_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, - pub lead_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub message_id: Option, + pub owner_name: Option, - pub reason: String, + pub pipeline_id: String, - pub stage: String, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct ConvertLeadRequest { - pub customer: ConversionCustomer, + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, - pub reason: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, - pub reference: String, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct ConvertLeadResponse { - pub conversion_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, - pub lead_id: String, + pub stage_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub message_id: Option, + pub stage_name: Option, - pub reason: String, + pub status: DealStatus, - pub stage: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct CreateLeadRequest { +pub struct ChangeDealStatusRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub campaign_id: Option, + pub convert_to_customer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ChangeDealStatusResponse { #[serde(skip_serializing_if = "Option::is_none")] pub company_id: Option, @@ -258,83 +357,101 @@ pub struct CreateLeadRequest { pub company_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub contact_name: Option, + pub contacts: Option>, + + pub created_at: String, #[serde(skip_serializing_if = "Option::is_none")] - pub date_deadline: Option, + pub created_by: Option, + + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, + pub days_in_stage: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub email_from: Option, + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub expected_revenue: Option, + pub expected_close_at: Option, + + pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub function: Option, + pub last_activity_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub medium_id: Option, + pub lost_reason: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub mobile: Option, + pub next_task_at: Option, - pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub partner_id: Option, + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, + pub owner_name: Option, + + pub pipeline_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub priority: Option, + pub pipeline_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub probability: Option, + pub primary_contact_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_plan_id: Option, + pub probability: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_revenue: Option, + pub source: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub referred_by: Option, + pub stage_entered_at: Option, + + pub stage_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub source_id: Option, + pub stage_name: Option, + + pub status: DealStatus, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_id: Option, + pub status_changed_at: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tag_ids: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub team_id: Option, + pub title: String, #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, + pub updated_at: Option, + + pub value: f64, - #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] - pub r#type: Option, + pub weighted_value: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ChangeStageRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub comment: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub website: Option, + pub lost_reason_id: Option, + + pub stage_id: String, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct CreateLeadResponse { +pub struct ChangeStageResponse { pub active: bool, #[serde(skip_serializing_if = "Option::is_none")] @@ -492,116 +609,319 @@ pub struct CreateLeadResponse { } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct CreateStageRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, +pub struct ConversionAddress { + pub city: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, + pub country: String, + + pub line1: String, #[serde(skip_serializing_if = "Option::is_none")] - pub fold: Option, + pub line2: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_lost: Option, + pub postal_code: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_won: Option, + pub region: Option, +} - pub name: String, +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ConversionCustomer { + pub address: ConversionAddress, - pub probability: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_name: Option, + + pub email: String, + + pub name: String, #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, + pub phone: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub rotting_threshold_days: Option, + pub tax_id: Option, +} - pub sequence: i32, +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ConversionResult { + pub conversion_id: String, + + pub lead_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub team_ids: Option>, + pub message_id: Option, + + pub reason: String, + + pub stage: String, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct CreateStageResponse { +pub struct ConvertLeadRequest { + pub customer: ConversionCustomer, + + pub reason: String, + + pub reference: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ConvertLeadResponse { + pub conversion_id: String, + + pub lead_id: String, + #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, + pub message_id: Option, + + pub reason: String, + + pub stage: String, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateDealRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, + pub company_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub fold: Option, + pub contacts: Option>, - pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_lost: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_won: Option, + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub lead_count: Option, + pub expected_close_at: Option, - pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, - pub probability: i32, + pub pipeline_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, + pub source: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub rotting_threshold_days: Option, + pub stage_id: Option, - pub sequence: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, #[serde(skip_serializing_if = "Option::is_none")] - pub team_ids: Option>, + pub value: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct DetectDuplicatesRequest { - pub email: String, +pub struct CreateDealResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, - pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, - pub phone: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, + + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub created_by: Option, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_close_at: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_name: Option, + + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, + + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct DetectDuplicatesResponse { - pub duplicates: Vec, +pub struct CreateDealRoleRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + pub title: String, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct DuplicateDetectionRequest { - pub email: String, +pub struct CreateDealRoleResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, - pub name: String, + pub id: String, - pub phone: String, -} + pub title: String, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct DuplicateDetectionResult { - pub duplicates: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub used_on: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct ErrorResponse { - pub code: i32, +pub struct CreateLeadRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub campaign_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub details: Option, + pub company_id: Option, - pub message: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_deadline: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub function: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub medium_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mobile: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub partner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub priority: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_plan_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub referred_by: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub user_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub website: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct GetLeadResponse { +pub struct CreateLeadResponse { pub active: bool, #[serde(skip_serializing_if = "Option::is_none")] @@ -759,56 +1079,157 @@ pub struct GetLeadResponse { } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct GetStageResponse { +pub struct CreatePipelineRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, + pub auto_assign: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, + pub auto_assign_user_ids: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub fold: Option, - - pub id: String, + pub clone_stages_from: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_lost: Option, + pub currency: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_won: Option, + pub forecast_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub lead_count: Option, + pub group_ids: Option>, pub name: String, - pub probability: i32, - - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub rotting_threshold_days: Option, - - pub sequence: i32, + pub sequence: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub team_ids: Option>, + pub visibility: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct Lead { - pub active: bool, +pub struct CreatePipelineResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub automated_probability: Option, + pub auto_assign_user_ids: Option>, + + pub created_at: String, + + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub campaign_id: Option, + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub id: String, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateStageRequest { #[serde(skip_serializing_if = "Option::is_none")] pub color: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub fold: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_lost: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_won: Option, + + pub name: String, + + pub probability: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_threshold_days: Option, + + pub sequence: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_ids: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct CreateStageResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub card_fields: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub deal_order: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub fold: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_lost: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_won: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lead_count: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + pub probability: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_days: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_threshold_days: Option, + + pub sequence: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_ids: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Deal { #[serde(skip_serializing_if = "Option::is_none")] pub company_id: Option, @@ -816,295 +1237,1846 @@ pub struct Lead { pub company_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub contact_name: Option, + pub contacts: Option>, - pub create_date: String, + pub created_at: String, #[serde(skip_serializing_if = "Option::is_none")] - pub date_closed: Option, + pub created_by: Option, + + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub date_deadline: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub date_last_stage_update: Option, + pub days_in_stage: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub date_open: Option, + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub day_close: Option, + pub expected_close_at: Option, + + pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub day_open: Option, + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_name: Option, + + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, + + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealContact { + pub contact_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub role_id: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealEmail { + pub at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub body_html: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clicked_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_id: Option, + + pub direction: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mailbox_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub opened_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub replied_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub saved_response_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub snippet: Option, + + pub subject: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub thread_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub to: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealRole { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + pub id: String, + + pub title: String, + #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate_lead_count: Option, + pub used_on: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealRoleRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate_lead_ids: Option>, + pub description: Option, + + pub title: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub default_pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub win_probability: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealStageChangeRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + pub stage_id: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] +pub enum DealStatus { + #[default] + #[serde(rename = "OPEN")] + Open, + + #[serde(rename = "WON")] + Won, + + #[serde(rename = "LOST")] + Lost, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DealStatusChangeRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub convert_to_customer: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectDuplicatesRequest { + pub email: String, + + pub name: String, + + pub phone: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DetectDuplicatesResponse { + pub duplicates: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DuplicateDetectionRequest { + pub email: String, + + pub name: String, + + pub phone: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct DuplicateDetectionResult { + pub duplicates: Vec, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ErrorResponse { + pub code: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub details: Option, + + pub message: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetDealResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, + + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub created_by: Option, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_close_at: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_name: Option, + + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, + + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetDealRoleResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + pub id: String, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub used_on: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetDealSettingsResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub default_pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub win_probability: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetLeadResponse { + pub active: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub automated_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub campaign_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_name: Option, + + pub create_date: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_closed: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_deadline: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_last_stage_update: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub day_close: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub day_open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_lead_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_lead_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email_normalized: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub function: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_automated_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_blacklisted: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_rotting: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub medium_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mobile: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub partner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_sanitized: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub priority: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub prorated_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_plan_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_revenue_monthly: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub referred_by: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + + #[serde(rename = "type")] + pub r#type: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub user_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub website: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_status: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub write_date: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub write_uid: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetPipelineResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + pub created_at: String, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub id: String, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetPipelineSummaryResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stages: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stalled: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stalled_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_this_month: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_value_this_month: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct GetStageResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub card_fields: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub deal_order: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub fold: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_lost: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_won: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lead_count: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + pub probability: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_days: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_threshold_days: Option, + + pub sequence: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_ids: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Lead { + pub active: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub automated_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub campaign_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_name: Option, + + pub create_date: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_closed: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_deadline: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_last_stage_update: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub date_open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub day_close: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub day_open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_lead_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_lead_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email_normalized: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub function: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_automated_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_blacklisted: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_rotting: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub medium_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mobile: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub partner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_sanitized: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub priority: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub prorated_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_plan_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_revenue: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring_revenue_monthly: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub referred_by: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + + #[serde(rename = "type")] + pub r#type: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub user_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub website: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_status: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub write_date: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub write_uid: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealActivityResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealEmailsResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealFilesResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealNotesResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealRolesResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListDealsResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListLeadsResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListPipelinesResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct ListStagesResponse { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MergeLeadsRequest { + pub keep_id: String, + + pub merge_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MergeLeadsResponse { + pub kept_id: String, + + pub merged_description_additions: i32, + + pub merged_id: String, + + pub merged_tag_count: i32, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct MergeResult { + pub kept_id: String, + + pub merged_description_additions: i32, + + pub merged_id: String, + + pub merged_tag_count: i32, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Note { + #[serde(skip_serializing_if = "Option::is_none")] + pub author: Option, + + pub created_at: String, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pinned: Option, + + pub text: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct NoteRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub pinned: Option, + + pub text: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedActivityEntry { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedAttachment { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedDeal { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedDealEmail { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedDealRole { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedLead { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedNote { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedPipeline { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedPipelineSummary { + pub stages: Vec, + + pub total_opportunities: i32, + + pub total_revenue: f64, + + pub total_weighted_revenue: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedResponse { + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PaginatedStage { + pub items: Vec, + + pub limit: i32, + + pub page: i32, + + pub total: i64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchDealRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_close_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchDealResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, + + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub created_by: Option, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_close_at: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_name: Option, + + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, + + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, + + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchDealRoleRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + pub title: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchDealRoleResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + pub id: String, + + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub used_on: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchPipelineRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PatchPipelineResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + pub created_at: String, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub id: String, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Pipeline { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + pub created_at: String, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub id: String, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PipelineRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PipelineSummary { + #[serde(skip_serializing_if = "Option::is_none")] + pub open: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stages: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stalled: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub stalled_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_this_month: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub won_value_this_month: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct PipelineSummaryResponse { + pub stages: Vec, + + pub total_opportunities: i32, + + pub total_revenue: f64, + + pub total_weighted_revenue: f64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SendDealEmailRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub attachment_ids: Option>, + + pub body_html: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub cc: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mailbox_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub saved_response_id: Option, + + pub subject: String, + + pub to: Vec, + + #[serde(skip_serializing_if = "Option::is_none")] + pub track_clicks: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub track_opens: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct SendDealEmailResponse { + pub at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub body_html: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clicked_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contact_id: Option, + + pub direction: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub from: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub mailbox_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub opened_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub replied_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub saved_response_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub snippet: Option, + + pub subject: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub thread_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub to: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Stage { + #[serde(skip_serializing_if = "Option::is_none")] + pub card_fields: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub deal_order: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub fold: Option, + + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_lost: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub is_won: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lead_count: Option, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + + pub probability: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_days: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_threshold_days: Option, + + pub sequence: i32, + + #[serde(skip_serializing_if = "Option::is_none")] + pub team_ids: Option>, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct StageChangeRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason_id: Option, + + pub stage_id: String, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealContactRequest { + pub contact_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub primary: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub role_id: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealContactResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, + + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub created_by: Option, + + pub currency: String, #[serde(skip_serializing_if = "Option::is_none")] - pub email_from: Option, + pub custom_fields: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub email_normalized: Option, + pub days_in_stage: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub expected_revenue: Option, + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub function: Option, + pub expected_close_at: Option, pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub is_automated_probability: Option, + pub last_activity_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_blacklisted: Option, + pub lost_reason: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub is_rotting: Option, + pub next_task_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub lost_reason_id: Option, + pub open_task_count: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub medium_id: Option, + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub mobile: Option, + pub owner_name: Option, - pub name: String, + pub pipeline_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub partner_id: Option, + pub pipeline_name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, + pub primary_contact_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub phone_sanitized: Option, + pub probability: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub priority: Option, + pub source: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub probability: Option, + pub stage_entered_at: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub prorated_revenue: Option, + pub stage_id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_plan_id: Option, + pub stage_name: Option, + + pub status: DealStatus, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_revenue: Option, + pub status_changed_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub recurring_revenue_monthly: Option, + pub tag_ids: Option>, + + pub title: String, #[serde(skip_serializing_if = "Option::is_none")] - pub referred_by: Option, + pub updated_at: Option, + + pub value: f64, #[serde(skip_serializing_if = "Option::is_none")] - pub source_id: Option, + pub weighted_value: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealNoteRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub stage_color: Option, + pub pinned: Option, + + pub text: String, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealNoteResponse { #[serde(skip_serializing_if = "Option::is_none")] - pub stage_id: Option, + pub author: Option, + + pub created_at: String, + + pub id: String, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_name: Option, + pub pinned: Option, + + pub text: String, #[serde(skip_serializing_if = "Option::is_none")] - pub stage_probability: Option, + pub updated_at: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub tag_ids: Option>, + pub company_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub team_id: Option, + pub currency: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, + pub custom_fields: Option, - #[serde(rename = "type")] - pub r#type: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub user_id: Option, + pub expected_close_at: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub website: Option, + pub owner_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub won_status: Option, + pub tag_ids: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub write_date: Option, + pub title: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub write_uid: Option, + pub value: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct ListLeadsResponse { - pub items: Vec, - - pub limit: i32, +pub struct UpdateDealResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub company_id: Option, - pub page: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub company_name: Option, - pub total: i64, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub contacts: Option>, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct ListStagesResponse { - pub items: Vec, + pub created_at: String, - pub limit: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub created_by: Option, - pub page: i32, + pub currency: String, - pub total: i64, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct MergeLeadsRequest { - pub keep_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub days_in_stage: Option, - pub merge_id: String, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct MergeLeadsResponse { - pub kept_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_close_at: Option, - pub merged_description_additions: i32, + pub id: String, - pub merged_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_activity_at: Option, - pub merged_tag_count: i32, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub lost_reason: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct MergeResult { - pub kept_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_task_at: Option, - pub merged_description_additions: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub open_task_count: Option, - pub merged_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_id: Option, - pub merged_tag_count: i32, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub owner_name: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct PaginatedLead { - pub items: Vec, + pub pipeline_id: String, - pub limit: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_name: Option, - pub page: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_contact_id: Option, - pub total: i64, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub probability: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct PaginatedPipelineSummary { - pub stages: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, - pub total_opportunities: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_entered_at: Option, - pub total_revenue: f64, + pub stage_id: String, - pub total_weighted_revenue: f64, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub stage_name: Option, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct PaginatedResponse { - pub limit: i32, + pub status: DealStatus, - pub page: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub status_changed_at: Option, - pub total: i64, -} + #[serde(skip_serializing_if = "Option::is_none")] + pub tag_ids: Option>, -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct PaginatedStage { - pub items: Vec, + pub title: String, - pub limit: i32, + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, - pub page: i32, + pub value: f64, - pub total: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub weighted_value: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct PipelineSummaryResponse { - pub stages: Vec, - - pub total_opportunities: i32, - - pub total_revenue: f64, +pub struct UpdateDealRoleRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, - pub total_weighted_revenue: f64, + pub title: String, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct Stage { - #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, - +pub struct UpdateDealRoleResponse { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub fold: Option, - pub id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub is_lost: Option, + pub title: String, #[serde(skip_serializing_if = "Option::is_none")] - pub is_won: Option, + pub used_on: Option, +} +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdateDealSettingsRequest { #[serde(skip_serializing_if = "Option::is_none")] - pub lead_count: Option, - - pub name: String, - - pub probability: i32, + pub default_currency: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, + pub default_pipeline_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub rotting_threshold_days: Option, - - pub sequence: i32, + pub require_expected_close_from_stage_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub team_ids: Option>, + pub win_probability: Option, } #[derive(Debug, Serialize, Deserialize, Default)] -pub struct StageChangeRequest { +pub struct UpdateDealSettingsResponse { #[serde(skip_serializing_if = "Option::is_none")] - pub comment: Option, + pub default_currency: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub lost_reason_id: Option, + pub default_pipeline_id: Option, - pub stage_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub win_probability: Option, } #[derive(Debug, Serialize, Deserialize, Default)] @@ -1353,6 +3325,73 @@ pub struct UpdateLeadResponse { pub write_uid: Option, } +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdatePipelineRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UpdatePipelineResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_assign_user_ids: Option>, + + pub created_at: String, + + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub group_ids: Option>, + + pub id: String, + + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + #[derive(Debug, Serialize, Deserialize, Default)] pub struct UpdateStageRequest { pub color: i32, @@ -1381,7 +3420,13 @@ pub struct UpdateStageRequest { #[derive(Debug, Serialize, Deserialize, Default)] pub struct UpdateStageResponse { #[serde(skip_serializing_if = "Option::is_none")] - pub color: Option, + pub card_fields: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub deal_order: Option, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, @@ -1402,11 +3447,17 @@ pub struct UpdateStageResponse { pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub pipeline_id: Option, + pub probability: i32, #[serde(skip_serializing_if = "Option::is_none")] pub requirements: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub rotting_days: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub rotting_threshold_days: Option, @@ -1415,3 +3466,23 @@ pub struct UpdateStageResponse { #[serde(skip_serializing_if = "Option::is_none")] pub team_ids: Option>, } + +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct UploadDealFileResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + + pub created_at: String, + + pub filename: String, + + pub id: String, + + pub size: i64, + + #[serde(skip_serializing_if = "Option::is_none")] + pub uploaded_by: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_deal.rs b/microservices/crm/pipeline/gen/src/handlers/update_deal.rs new file mode 100644 index 00000000..afcb13bb --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_deal.rs @@ -0,0 +1,233 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_id")] + pub stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "value")] + pub value: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_deal::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_deal_contact.rs b/microservices/crm/pipeline/gen/src/handlers/update_deal_contact.rs new file mode 100644 index 00000000..ce1f3bef --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_deal_contact.rs @@ -0,0 +1,221 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use crate::handlers::types::DealContact; +use crate::handlers::types::DealStatus; +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "contact_id")] + pub contact_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "email")] + pub email: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "name")] + pub name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary")] + pub primary: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "role")] + pub role: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "role_id")] + pub role_id: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "contact_id")] + pub contact_id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_id")] + pub company_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "company_name")] + pub company_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "contacts")] + pub contacts: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "created_by")] + pub created_by: Option, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "custom_fields")] + pub custom_fields: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "days_in_stage")] + pub days_in_stage: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "expected_close_at")] + pub expected_close_at: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "last_activity_at")] + pub last_activity_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "lost_reason")] + pub lost_reason: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "next_task_at")] + pub next_task_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_task_count")] + pub open_task_count: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_id")] + pub owner_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "owner_name")] + pub owner_name: Option, + + #[serde(rename = "pipeline_id")] + pub pipeline_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_name")] + pub pipeline_name: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "primary_contact_id")] + pub primary_contact_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "probability")] + pub probability: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "source")] + pub source: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_entered_at")] + pub stage_entered_at: Option, + + #[serde(rename = "stage_id")] + pub stage_id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "stage_name")] + pub stage_name: Option, + + #[serde(rename = "status")] + pub status: DealStatus, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "status_changed_at")] + pub status_changed_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "tag_ids")] + pub tag_ids: Option>, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(rename = "value")] + pub value: f64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "weighted_value")] + pub weighted_value: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_path_param("contact_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "contact_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'contact_id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_deal_contact::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_deal_note.rs b/microservices/crm/pipeline/gen/src/handlers/update_deal_note.rs new file mode 100644 index 00000000..fd33a54e --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_deal_note.rs @@ -0,0 +1,104 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pinned")] + pub pinned: Option, + + #[serde(rename = "text")] + pub text: String, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "note_id")] + pub note_id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "author")] + pub author: Option, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "id")] + pub id: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pinned")] + pub pinned: Option, + + #[serde(rename = "text")] + pub text: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(v) = req.get_path_param("note_id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "note_id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'note_id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_deal_note::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_deal_role.rs b/microservices/crm/pipeline/gen/src/handlers/update_deal_role.rs new file mode 100644 index 00000000..17a6b614 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_deal_role.rs @@ -0,0 +1,82 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "title")] + pub title: String, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "description")] + pub description: Option, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "title")] + pub title: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "used_on")] + pub used_on: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_deal_role::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_deal_settings.rs b/microservices/crm/pipeline/gen/src/handlers/update_deal_settings.rs new file mode 100644 index 00000000..8327a4e3 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_deal_settings.rs @@ -0,0 +1,78 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_currency")] + pub default_currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_pipeline_id")] + pub default_pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "require_expected_close_from_stage_id")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "win_probability")] + pub win_probability: Option, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_currency")] + pub default_currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "default_pipeline_id")] + pub default_pipeline_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "require_expected_close_from_stage_id")] + pub require_expected_close_from_stage_id: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "win_probability")] + pub win_probability: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_deal_settings::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_pipeline.rs b/microservices/crm/pipeline/gen/src/handlers/update_pipeline.rs new file mode 100644 index 00000000..ecff8747 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/update_pipeline.rs @@ -0,0 +1,144 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "clone_stages_from")] + pub clone_stages_from: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "currency")] + pub currency: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, + + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign")] + pub auto_assign: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "auto_assign_user_ids")] + pub auto_assign_user_ids: Option>, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "currency")] + pub currency: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "forecast_mode")] + pub forecast_mode: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "group_ids")] + pub group_ids: Option>, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "name")] + pub name: String, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_deals")] + pub open_deals: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "open_value")] + pub open_value: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "sequence")] + pub sequence: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "updated_at")] + pub updated_at: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "visibility")] + pub visibility: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::update_pipeline::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/handlers/update_stage.rs b/microservices/crm/pipeline/gen/src/handlers/update_stage.rs index 8f9e0211..44f92b6f 100644 --- a/microservices/crm/pipeline/gen/src/handlers/update_stage.rs +++ b/microservices/crm/pipeline/gen/src/handlers/update_stage.rs @@ -50,9 +50,17 @@ pub struct Request { #[derive(Debug, Deserialize, Serialize)] pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "card_fields")] + pub card_fields: Option>, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "color")] - pub color: Option, + pub color: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "deal_order")] + pub deal_order: Option, #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "description")] @@ -80,6 +88,10 @@ pub struct Response { #[serde(rename = "name")] pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "pipeline_id")] + pub pipeline_id: Option, + #[serde(rename = "probability")] pub probability: i32, @@ -87,6 +99,10 @@ pub struct Response { #[serde(rename = "requirements")] pub requirements: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "rotting_days")] + pub rotting_days: Option, + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "rotting_threshold_days")] pub rotting_threshold_days: Option, diff --git a/microservices/crm/pipeline/gen/src/handlers/upload_deal_file.rs b/microservices/crm/pipeline/gen/src/handlers/upload_deal_file.rs new file mode 100644 index 00000000..adebe006 --- /dev/null +++ b/microservices/crm/pipeline/gen/src/handlers/upload_deal_file.rs @@ -0,0 +1,85 @@ +// ⚠️ WARNING: This file is auto-generated by BRRTRouter +// ⚠️ DO NOT MODIFY - Changes will be overwritten on next generation +// ⚠️ To modify API behavior, edit the OpenAPI spec and regenerate +// ⚠️ To implement business logic, edit the corresponding controller file +use brrtrouter::dispatcher::HandlerRequest; +use brrtrouter::typed::HttpJson; +use brrtrouter::typed::TypedHandlerRequest; +use serde::{Deserialize, Serialize}; +use std::convert::TryFrom; + +#[derive(Debug, Deserialize, Serialize)] +pub struct Request { + #[serde(rename = "id")] + pub id: String, +} + +#[derive(Debug, Deserialize, Serialize)] + +pub struct Response { + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "content_type")] + pub content_type: Option, + + #[serde(rename = "created_at")] + pub created_at: String, + + #[serde(rename = "filename")] + pub filename: String, + + #[serde(rename = "id")] + pub id: String, + + #[serde(rename = "size")] + pub size: i64, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "uploaded_by")] + pub uploaded_by: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "url")] + pub url: Option, +} + +impl TryFrom for Request { + type Error = anyhow::Error; + + fn try_from(req: HandlerRequest) -> Result { + use serde_json::{Map, Value}; + + let mut data_map = Map::new(); + + if let Some(v) = req.get_path_param("id") { + // Built once, not per request: decode_param_value reads only its types. + static SCHEMA: std::sync::LazyLock = + std::sync::LazyLock::new(|| serde_json::json!({"format":"uuid","type":"string"})); + data_map.insert( + "id".to_string(), + brrtrouter::server::request::decode_param_value(v, Some(&*SCHEMA), None, None), + ); + } else { + return Err(anyhow::anyhow!("Missing required parameter 'id'")); + } + + if let Some(body) = req.body { + match body { + Value::Object(map) => { + for (k, v) in map { + data_map.insert(k, v); + } + } + other => { + data_map.insert("body".to_string(), other); + } + } + } + + Ok(serde_json::from_value(Value::Object(data_map))?) + } +} + +#[allow(dead_code)] +pub fn handler(req: TypedHandlerRequest) -> HttpJson { + crate::controllers::upload_deal_file::handle(req) +} diff --git a/microservices/crm/pipeline/gen/src/registry.rs b/microservices/crm/pipeline/gen/src/registry.rs index b29832fe..00f750de 100644 --- a/microservices/crm/pipeline/gen/src/registry.rs +++ b/microservices/crm/pipeline/gen/src/registry.rs @@ -17,6 +17,174 @@ use brrtrouter::typed::spawn_typed_with_stack_size_and_name; /// Spawns handler coroutines. Callers must ensure coroutine runtime is set up. #[allow(dead_code)] pub unsafe fn register_all(dispatcher: &mut Dispatcher) { + dispatcher.register_typed_with_stack_size( + "list_deal_roles", + crate::controllers::list_deal_roles::ListDealRolesController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "create_deal_role", + crate::controllers::create_deal_role::CreateDealRoleController, + 16384, + ); + + dispatcher.register_typed_with_stack_size( + "get_deal_role", + crate::controllers::get_deal_role::GetDealRoleController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "update_deal_role", + crate::controllers::update_deal_role::UpdateDealRoleController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "delete_deal_role", + crate::controllers::delete_deal_role::DeleteDealRoleController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "patch_deal_role", + crate::controllers::patch_deal_role::PatchDealRoleController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "list_deals", + crate::controllers::list_deals::ListDealsController, + 32768, + ); + + dispatcher.register_typed_with_stack_size( + "create_deal", + crate::controllers::create_deal::CreateDealController, + 16384, + ); + + dispatcher.register_typed_with_stack_size( + "bulk_update_deals", + crate::controllers::bulk_update_deals::BulkUpdateDealsController, + 16384, + ); + + dispatcher.register_typed_with_stack_size( + "get_deal", + crate::controllers::get_deal::GetDealController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "update_deal", + crate::controllers::update_deal::UpdateDealController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "delete_deal", + crate::controllers::delete_deal::DeleteDealController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "patch_deal", + crate::controllers::patch_deal::PatchDealController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "list_deal_activity", + crate::controllers::list_deal_activity::ListDealActivityController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "add_deal_contact", + crate::controllers::add_deal_contact::AddDealContactController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "remove_deal_contact", + crate::controllers::remove_deal_contact::RemoveDealContactController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "update_deal_contact", + crate::controllers::update_deal_contact::UpdateDealContactController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "list_deal_emails", + crate::controllers::list_deal_emails::ListDealEmailsController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "send_deal_email", + crate::controllers::send_deal_email::SendDealEmailController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "list_deal_files", + crate::controllers::list_deal_files::ListDealFilesController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "upload_deal_file", + crate::controllers::upload_deal_file::UploadDealFileController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "delete_deal_file", + crate::controllers::delete_deal_file::DeleteDealFileController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "list_deal_notes", + crate::controllers::list_deal_notes::ListDealNotesController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "add_deal_note", + crate::controllers::add_deal_note::AddDealNoteController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "delete_deal_note", + crate::controllers::delete_deal_note::DeleteDealNoteController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "update_deal_note", + crate::controllers::update_deal_note::UpdateDealNoteController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "change_deal_stage", + crate::controllers::change_deal_stage::ChangeDealStageController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "change_deal_status", + crate::controllers::change_deal_status::ChangeDealStatusController, + 20480, + ); + dispatcher.register_typed_with_stack_size( "list_leads", crate::controllers::list_leads::ListLeadsController, @@ -77,6 +245,60 @@ pub unsafe fn register_all(dispatcher: &mut Dispatcher) { 20480, ); + dispatcher.register_typed_with_stack_size( + "list_pipelines", + crate::controllers::list_pipelines::ListPipelinesController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "create_pipeline", + crate::controllers::create_pipeline::CreatePipelineController, + 16384, + ); + + dispatcher.register_typed_with_stack_size( + "get_pipeline", + crate::controllers::get_pipeline::GetPipelineController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "update_pipeline", + crate::controllers::update_pipeline::UpdatePipelineController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "delete_pipeline", + crate::controllers::delete_pipeline::DeletePipelineController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "patch_pipeline", + crate::controllers::patch_pipeline::PatchPipelineController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "get_pipeline_summary", + crate::controllers::get_pipeline_summary::GetPipelineSummaryController, + 20480, + ); + + dispatcher.register_typed_with_stack_size( + "get_deal_settings", + crate::controllers::get_deal_settings::GetDealSettingsController, + 16384, + ); + + dispatcher.register_typed_with_stack_size( + "update_deal_settings", + crate::controllers::update_deal_settings::UpdateDealSettingsController, + 16384, + ); + dispatcher.register_typed_with_stack_size( "list_stages", crate::controllers::list_stages::ListStagesController, @@ -122,6 +344,230 @@ pub unsafe fn register_from_spec(dispatcher: &mut Dispatcher, routes: &[RouteMet for route in routes { match route.handler_name.as_ref() { + "list_deal_roles" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deal_roles::ListDealRolesController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "create_deal_role" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::create_deal_role::CreateDealRoleController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "get_deal_role" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::get_deal_role::GetDealRoleController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_deal_role" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_deal_role::UpdateDealRoleController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "delete_deal_role" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::delete_deal_role::DeleteDealRoleController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "patch_deal_role" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::patch_deal_role::PatchDealRoleController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "list_deals" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deals::ListDealsController, + 32768, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "create_deal" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::create_deal::CreateDealController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "bulk_update_deals" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::bulk_update_deals::BulkUpdateDealsController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "get_deal" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::get_deal::GetDealController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_deal" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_deal::UpdateDealController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "delete_deal" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::delete_deal::DeleteDealController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "patch_deal" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::patch_deal::PatchDealController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "list_deal_activity" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deal_activity::ListDealActivityController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "add_deal_contact" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::add_deal_contact::AddDealContactController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "remove_deal_contact" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::remove_deal_contact::RemoveDealContactController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_deal_contact" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_deal_contact::UpdateDealContactController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "list_deal_emails" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deal_emails::ListDealEmailsController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "send_deal_email" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::send_deal_email::SendDealEmailController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "list_deal_files" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deal_files::ListDealFilesController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "upload_deal_file" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::upload_deal_file::UploadDealFileController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "delete_deal_file" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::delete_deal_file::DeleteDealFileController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "list_deal_notes" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_deal_notes::ListDealNotesController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "add_deal_note" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::add_deal_note::AddDealNoteController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "delete_deal_note" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::delete_deal_note::DeleteDealNoteController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_deal_note" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_deal_note::UpdateDealNoteController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "change_deal_stage" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::change_deal_stage::ChangeDealStageController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "change_deal_status" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::change_deal_status::ChangeDealStatusController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } "list_leads" => { let tx = spawn_typed_with_stack_size_and_name( crate::controllers::list_leads::ListLeadsController, @@ -202,6 +648,78 @@ pub unsafe fn register_from_spec(dispatcher: &mut Dispatcher, routes: &[RouteMet ); dispatcher.add_route(route.clone(), tx); } + "list_pipelines" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::list_pipelines::ListPipelinesController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "create_pipeline" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::create_pipeline::CreatePipelineController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "get_pipeline" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::get_pipeline::GetPipelineController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_pipeline" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_pipeline::UpdatePipelineController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "delete_pipeline" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::delete_pipeline::DeletePipelineController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "patch_pipeline" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::patch_pipeline::PatchPipelineController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "get_pipeline_summary" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::get_pipeline_summary::GetPipelineSummaryController, + 20480, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "get_deal_settings" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::get_deal_settings::GetDealSettingsController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } + "update_deal_settings" => { + let tx = spawn_typed_with_stack_size_and_name( + crate::controllers::update_deal_settings::UpdateDealSettingsController, + 16384, + Some(route.handler_name.as_ref()), + ); + dispatcher.add_route(route.clone(), tx); + } "list_stages" => { let tx = spawn_typed_with_stack_size_and_name( crate::controllers::list_stages::ListStagesController,