Enhance law management functionality and API
Updated ILawApplication with new methods for activating and deactivating laws by type. Added UpsertLaw method for creating and updating laws. Modified LawViewModel and EditLaw to include LawType. Enhanced LawApplication methods to support new features and updated GetLawByType to return default laws when none exist. Introduced LawController with endpoints for law operations.
This commit is contained in:
@@ -10,13 +10,15 @@ namespace CompanyManagment.App.Contracts.Law
|
||||
OperationResult Edit(EditLaw command);
|
||||
OperationResult Activate(long id);
|
||||
OperationResult Deactivate(long id);
|
||||
OperationResult ActivateByType(LawType type);
|
||||
OperationResult DeactivateByType(LawType type);
|
||||
EditLaw GetDetails(long id);
|
||||
List<LawViewModel> GetList();
|
||||
Task<LawViewModel> GetLawWithItems(long id);
|
||||
|
||||
Task<LawViewModel> GetLawByType(LawType type);
|
||||
|
||||
OperationResult UpsertLaw(EditLaw command);
|
||||
}
|
||||
|
||||
public enum LawType
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CompanyManagment.App.Contracts.Law
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public List<LawItemViewModel> Items { get; set; }
|
||||
public LawType Type { get; set; }
|
||||
}
|
||||
|
||||
public class LawItemViewModel
|
||||
@@ -33,6 +34,7 @@ namespace CompanyManagment.App.Contracts.Law
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public List<LawItemViewModel> Items { get; set; }
|
||||
|
||||
public LawType Type { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user