import 'package:json_annotation/json_annotation.dart';

import 'package:pshared/data/dto/permissions/action_effect.dart';

part 'permission.g.dart';


@JsonSerializable()
class PermissionDTO {
  final String roleDescriptionRef;
  final String organizationRef;
  final String descriptionRef;
  final String? objectRef;
  final ActionEffectDTO effect;
  final String accountRef;

  const PermissionDTO({
    required this.roleDescriptionRef,
    required this.organizationRef,
    required this.descriptionRef,
    required this.objectRef,
    required this.effect,
    required this.accountRef,
  });
  
  factory PermissionDTO.fromJson(Map<String, dynamic> json) => _$PermissionDTOFromJson(json);
  Map<String, dynamic> toJson() => _$PermissionDTOToJson(this);  
}
