| | | 1 | | using SVETA.Api.Data.Domain; |
| | | 2 | | using WinSolutions.Sveta.Server.Data.DataModel.Entities; |
| | | 3 | | using WinSolutions.Sveta.Server.Data.DataModel.Kinds; |
| | | 4 | | |
| | | 5 | | namespace SVETA.Api.Helpers |
| | | 6 | | { |
| | | 7 | | public static class MovementHelpers |
| | | 8 | | { |
| | | 9 | | public static string CreateLink(Movement movement, CommonSettings commonSettings) |
| | 285 | 10 | | { |
| | 285 | 11 | | string type = CreatePostfixLink(movement.MovementType); |
| | 285 | 12 | | return $"<a class='notification-link' href='{commonSettings.BaseFrontUrl}/{type}/{movement.Id}'>{movement.Do |
| | 285 | 13 | | } |
| | | 14 | | |
| | 285 | 15 | | public static string CreatePostfixLink(MovementType type) => type.Id switch |
| | 285 | 16 | | { |
| | 285 | 17 | | (long) MovementKind.Order => $"orders", |
| | 285 | 18 | | (long) MovementKind.Shipment => $"shipments", |
| | 285 | 19 | | _ => default |
| | 285 | 20 | | }; |
| | | 21 | | } |
| | | 22 | | } |