Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git ref #30

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

Git ref #30

wants to merge 49 commits into from

Conversation

arrrrny
Copy link

@arrrrny arrrrny commented Dec 16, 2024

This version has the ability to create the missing sub entity from patch if possible and give a run time error if it fails.

    Customer x = Customer(
      id: '12121',
      yearOfBirth: 1984,
      // profile: CustomerProfile(
      //   gender: Gender.woman,
      // ),
    );

    final profilePatch = CustomerProfilePatch()
        .withOccupation('Software Engineer')
        .withIsMarried(true)
        .withGender(Gender.man);

customerPatch =
        CustomerPatch().withProfilePatch(profilePatch).withFirstName('John')
x = customerPatch.applyTo(x);

here is how I already use on my project. I keep the lean version of jsons in Patch entities so that it can be easily used by supabase, firebase etc.

  @override
  Future<void> update(CustomerPatch patch) async {
    await _firestore
        .collection(_collection)
        .doc(currentCustomer!.id)
        .update(patch.toJson());
    currentCustomer = currentCustomer!.copyWithCustomer(patchInput: patch);
  }
  

miklcct and others added 30 commits May 16, 2024 14:23
…t, Map

Also preserve type aliases in generated files

Fixes atreeon#15
# Conflicts:
#	morphy/lib/morphy2Builder.dart
#	morphy/lib/morphyBuilder.dart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants