unit LoginRequest;

interface

uses
  Pkg.Json.DTO,
  System.Generics.Collections,
  REST.Json.Types,
  BaseRequest;

{$M+}

type
  TLoginInfo = class
  private
    FCarNumber: string;
    FDistrict: string;
    FMileage: string;
    FShift: string;
    FShiftDate: string;
    FUnitName: string;
    FUnitType: string;
  published
    property CarNumber: string read FCarNumber write FCarNumber;
    property District: string read FDistrict write FDistrict;
    property Mileage: string read FMileage write FMileage;
    property Shift: string read FShift write FShift;
    property ShiftDate: string read FShiftDate write FShiftDate;
    property UnitName: string read FUnitName write FUnitName;
    property UnitType: string read FUnitType write FUnitType;
  end;

  TLoginRequest = class(TRequest)
  private
    [JSONName('device_id')]
    FDeviceId: string;
    FLoginInfo: TLoginInfo;
    FPass: string;
    FRelogin: Boolean;
    FRequestId: string;
    FSessionId: string;
    FUnitnumber: string;
    FUser: string;
    FVersion: string;
  published
    property DeviceId: string read FDeviceId write FDeviceId;
    property LoginInfo: TLoginInfo read FLoginInfo;
    property Pass: string read FPass write FPass;
    property Relogin: Boolean read FRelogin write FRelogin;
    property RequestId: string read FRequestId write FRequestId;
    property SessionId: string read FSessionId write FSessionId;
    property Unitnumber: string read FUnitnumber write FUnitnumber;
    property User: string read FUser write FUser;
    property Version: string read FVersion write FVersion;
  public
    constructor Create; override;
    destructor Destroy; override;
  end;

implementation

{ TLoginRequest }

constructor TLoginRequest.Create;
begin
  inherited;
  FLoginInfo := TLoginInfo.Create;
end;

destructor TLoginRequest.Destroy;
begin
  FLoginInfo.Free;
  inherited;
end;

end.
