deco-cx / apps

App definitions by deco.cx
Apache License 2.0
82 stars 85 forks source link

Refactoring Linx duplicated types #832

Closed Samuel-Brito19 closed 2 months ago

Samuel-Brito19 commented 3 months ago

Working to mitigate unnecessary duplicated types on Linx related types.

viktormarinho commented 3 months ago

Once you are happy with the progress here you can tag me @Samuel-Brito19 !

Btw: I don't think you need to update the deco version, seems out of scope for this PR

Samuel-Brito19 commented 3 months ago

Hi @viktormarinho! I did some modifications trying to solve the problem, but I have some doubts about some cases. For example, this Response interface is present in 3 files but have no use in none of them. Should I take it off?

export interface Response {
  Errors: LinxError[];
  IsValid: boolean;
  RefreshBasket: boolean;
  ResponseCallBack: ResponseCallBack;
  SuccessMessage: null;
  Url: null;
  Warnings: unknown[];
}

There's other cases similar to that one. Check my changes and please give me a feedback!

viktormarinho commented 2 months ago

Hi @viktormarinho! I did some modifications trying to solve the problem, but I have some doubts about some cases. For example, this Response interface is present in 3 files but have no use in none of them. Should I take it off?

export interface Response {
  Errors: LinxError[];
  IsValid: boolean;
  RefreshBasket: boolean;
  ResponseCallBack: ResponseCallBack;
  SuccessMessage: null;
  Url: null;
  Warnings: unknown[];
}

There's other cases similar to that one. Check my changes and please give me a feedback!

@Samuel-Brito19 If there are types without usage i believe you can delete them. Can you share the other cases? For the Response case it's ok.